Merge branch 'master' into pygromacs
authorAlexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Fri, 5 Jun 2015 20:36:40 +0000 (23:36 +0300)
committerAlexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Fri, 5 Jun 2015 20:36:40 +0000 (23:36 +0300)
86 files changed:
CMakeLists.txt
COPYING
admin/InstallInfo.txt
cmake/FindFFTW.cmake
cmake/ThreadMPI.cmake
cmake/gmxBuildTypeReference.cmake
cmake/gmxCPackUtilities.cmake
cmake/gmxManageSharedLibraries.cmake
cmake/gmxManageSimd.cmake
cmake/gmxTestCompilerProblems.cmake
docs/CMakeLists.txt
docs/conf.py
docs/dev-manual/gmxtree.rst
docs/doxygen/includesorter.py
docs/doxygen/lib/simd.md
docs/doxygen/lib/wrapperbinary.md
docs/doxygen/user/mainpage.md
docs/doxygen/user/onlinehelp.md [new file with mode: 0644]
docs/man/.gitignore [deleted file]
docs/man/gromacs.7.rst [deleted file]
docs/manual/algorithms.tex
docs/user-guide/environment-variables.rst
docs/user-guide/file-formats.rst
docs/user-guide/getting-started.rst
share/template/Makefile.pkg
share/template/template.cpp
share/top/gurgle.dat
src/contrib/README
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/refdata/CommandLineHelpModuleTest_ExportsHelp.xml
src/gromacs/fileio/gmx_system_xdr.c
src/gromacs/fileio/mtxio.c
src/gromacs/fileio/tpxio.c
src/gromacs/fileio/vmdio.c
src/gromacs/gmxana/gmx_anaeig.c
src/gromacs/gmxana/gmx_density.c
src/gromacs/gmxana/gmx_energy.c
src/gromacs/gmxana/gmx_principal.c
src/gromacs/gmxana/gmx_spatial.c
src/gromacs/gmxana/gmx_trjorder.c
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxlib/checkpoint.cpp
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/gmx_cpuid.c
src/gromacs/gmxpreprocess/grompp.c
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/readir.c
src/gromacs/linearalgebra/gmx_blas/blas_copyright
src/gromacs/linearalgebra/gmx_lapack/lapack_copyright
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/ns.c
src/gromacs/mdlib/tpi.cpp
src/gromacs/onlinehelp-doc.h [new file with mode: 0644]
src/gromacs/onlinehelp/helptopicinterface.h
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/onlinehelp/rstparser.cpp [new file with mode: 0644]
src/gromacs/onlinehelp/rstparser.h [new file with mode: 0644]
src/gromacs/onlinehelp/tests/helpwritercontext.cpp
src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsGridTable.xml [new file with mode: 0644]
src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsLiteralTextWithIndentation.xml [new file with mode: 0644]
src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsSimpleTable.xml [new file with mode: 0644]
src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsTitles.xml [new file with mode: 0644]
src/gromacs/pbcutil/pbc-simd.h
src/gromacs/selection/compiler.cpp
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx.h
src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h
src/gromacs/simd/impl_intel_mic/impl_intel_mic.h
src/gromacs/simd/impl_reference/impl_reference.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h
src/gromacs/simd/impl_x86_avx_512f/impl_x86_avx_512f.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2.h
src/gromacs/utility/baseversion-gen.h
src/gromacs/utility/gmxregex.cpp
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/tests/refdata/TextLineWrapperTest_HandlesIndentWithEmptyLines.xml [new file with mode: 0644]
src/gromacs/utility/tests/stringutil.cpp
src/programs/legacymodules.cpp
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/runner.cpp
src/programs/view/view.cpp

index d6df9b467d59d55616ef60ac6acb6012cb536990..0d956e1cd57ed67816ca23cfd7b2a9cd0c1f4028 100644 (file)
@@ -158,7 +158,7 @@ mark_as_advanced(GMX_SOFTWARE_INVSQRT)
 option(GMX_FAHCORE "Build a library with mdrun functionality" OFF)
 mark_as_advanced(GMX_FAHCORE)
 
-option(GMX_COOL_QUOTES "Enable Gromacs cool quotes" ON)
+option(GMX_COOL_QUOTES "Enable GROMACS cool quotes" ON)
 mark_as_advanced(GMX_COOL_QUOTES)
 gmx_add_cache_dependency(GMX_COOL_QUOTES BOOL "NOT GMX_FAHCORE" OFF)
 
@@ -498,7 +498,7 @@ if(NOT DEFINED GMX_EXTERNAL_BOOST OR GMX_EXTERNAL_BOOST)
     if(NOT DEFINED GMX_EXTERNAL_BOOST AND NOT Boost_FOUND)
         message("Boost >= 1.44 not found. Using minimal internal version. "
                 "This may cause trouble if you plan on compiling/linking other "
-                "software that uses Boost against Gromacs.")
+                "software that uses Boost against GROMACS.")
     endif()
 endif()
 option(GMX_EXTERNAL_BOOST "Use external Boost instead of minimal built-in version"
@@ -507,7 +507,7 @@ if(GMX_EXTERNAL_BOOST AND NOT Boost_FOUND)
     message(FATAL_ERROR
         "Boost >= 1.44 not found. "
         "You can set GMX_EXTERNAL_BOOST=OFF to compile against minimal "
-        "version of Boost included with Gromacs.")
+        "version of Boost included with GROMACS.")
 endif()
 
 if(NOT DEFINED GMX_BUILD_UNITTESTS AND NOT HAVE_LIBXML2)
diff --git a/COPYING b/COPYING
index e2737f31982168c1f06adf4897400208fe093149..7d7b8dda2ab5a98e5dbe60f27c46651d14363106 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1005,7 +1005,7 @@ be called official thread_mpi.
 
 These files are semi-automatic translations by f2c from the original netlib BLAS library.
 The source has been modified to (mostly) use modern C formatting, and to get rid of
-compiler warnings. Any errors in doing this should be blamed on the Gromacs developers, and
+compiler warnings. Any errors in doing this should be blamed on the GROMACS developers, and
 not the reference BLAS implementation.
 
 The reference BLAS implementation is available from http://www.netlib.org/blas
@@ -1016,10 +1016,10 @@ BLAS does not come with a formal named "license", but a general statement that
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
+While the rest of GROMACS is LGPL, we think it's only fair to give you the same rights to
 our modified BLAS files as the original netlib versions, so do what you want with them.
 However, be warned that we have only tested that they to the right thing in the cases used
-in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
+in GROMACS (primarily full & sparse matrix diagonalization), so in most cases it is a much
 better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
@@ -1029,7 +1029,7 @@ Erik Lindahl, 2008-10-07.
 
 These files are semi-automatic translations by f2c from the original netlib LAPACK library.
 The source has been modified to (mostly) use modern C formatting, and to get rid of
-compiler warnings. Any errors in doing this should be blamed on the Gromacs developers, and
+compiler warnings. Any errors in doing this should be blamed on the GROMACS developers, and
 not the reference LAPACK implementation.
 
 The reference LAPACK implementation is available from http://www.netlib.org/lapack
@@ -1040,11 +1040,11 @@ LAPACK does not come with a formal named "license", but a general statement sayi
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
+While the rest of GROMACS is LGPL, we think it's only fair to give you the same rights to
 our modified LAPACK files as the original netlib versions, so do what you want with them.
 
 However, be warned that we have only tested that they to the right thing in the cases used
-in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
+in GROMACS (primarily full & sparse matrix diagonalization), so in most cases it is a much
 better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
index a50de8680acd92649e0aeee94370d6d90dfe068a..046930918f955b40ef6942a902248eeb9481b7a1 100644 (file)
@@ -1,4 +1,4 @@
-Gromacs is a versatile and high-performance toolkit for molecular simulations, and extensively used both in biomolecular and materials sciences.
+GROMACS is a versatile and high-performance toolkit for molecular simulations, and extensively used both in biomolecular and materials sciences.
 
 The precompiled binary distributions come with threads support for efficient parallelization on multi-core workstations, but if you want to use large-scale MPI parallelization you will need to build from source on the target system due to MPI library compatibility issues.
 
index dbe8f92c4bcc731bb6ef25f3f43432c375a1cb56..bea6f0b0f772e920fd0941b0c54076df655b9912 100644 (file)
@@ -164,7 +164,7 @@ if (${FFTW}_FOUND)
       execute_process(COMMAND ${CMAKE_OBJDUMP} --reloc ${${FFTW}_LIBRARY} OUTPUT_VARIABLE ${FFTW}_OBJDUMP)
       if (${${FFTW}_OBJDUMP} MATCHES "R_X86_64" #Should always be true for static libraries. Checks that objdump works properly and that the library isn't dynamic
               AND NOT ${${FFTW}_OBJDUMP} MATCHES "R_X86_64_PLT32")
-          message(FATAL_ERROR "The FFTW library ${${FFTW}_LIBRARY} cannot be used with shared libraries. Provide a different FFTW library by setting ${FFTW}_LIBRARY. If you don't have a different one, recompile FFTW with \"--enable-shared\" or \"--with-pic\". Or disable shared libraries for Gromacs by setting BUILD_SHARED_LIBS to \"no\". Note: Disabling shared libraries requires up to 10x as much disk space.")
+          message(FATAL_ERROR "The FFTW library ${${FFTW}_LIBRARY} cannot be used with shared libraries. Provide a different FFTW library by setting ${FFTW}_LIBRARY. If you don't have a different one, recompile FFTW with \"--enable-shared\" or \"--with-pic\". Or disable shared libraries for GROMACS by setting BUILD_SHARED_LIBS to \"no\". Note: Disabling shared libraries requires up to 10x as much disk space.")
       endif()
   endif()
   set(CMAKE_REQUIRED_LIBRARIES)
index 027eff6918746d658974f7e189db78167ca9661d..9a06115e732d7f66cb7cc8c63271b4d08c1b78c6 100644 (file)
@@ -67,7 +67,7 @@ try_compile(HAVE_PROCESSOR_NUMBER ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/cmake
 include(FindThreads)
 
 if(CMAKE_USE_WIN32_THREADS_INIT AND NOT HAVE_PROCESSOR_NUMBER)
-    message(WARNING "Incomplete Windows Processor Group API. If you want Gromacs to be able to set thread affinity, choose a Mingw distribution with a complete API (e.g. Mingw-w64).")
+    message(WARNING "Incomplete Windows Processor Group API. If you want GROMACS to be able to set thread affinity, choose a Mingw distribution with a complete API (e.g. Mingw-w64).")
 endif()
 
 if (CMAKE_USE_WIN32_THREADS_INIT AND HAVE_PROCESSOR_NUMBER)
index 6f068efef813b42613cf6c19245930f213387e88..56fefbfb88d8a298dcb90abaf4502d7c61792990 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.
@@ -33,7 +33,7 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 # Custom build type "Reference", to be used for creating new
-# reference values in the Gromacs regression tests.
+# reference values in the GROMACS regression tests.
 set( CMAKE_CXX_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C++ flags for regressiontests reference runs." FORCE)
 set( CMAKE_C_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C flags for regressiontests reference runs." FORCE)
 set( CMAKE_EXE_LINKER_FLAGS_REFERENCE "" CACHE STRING "Linker flags for regressiontests reference runs.")
@@ -49,7 +49,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Reference")
     set(GMX_THREAD_MPI OFF CACHE BOOL "Disabled for regressiontests reference builds" FORCE)
 
     if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR NOT "${CMAKE_C_COMPILER_VERSION}" MATCHES "4.7")
-        message(WARNING "Reference values for regressiontests should use Gromacs compiled with "
+        message(WARNING "Reference values for regressiontests should use GROMACS compiled with "
             "gcc 4.7, but your configuration is using ${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}.")
     endif()
 endif()
index bf22099d6c1d123f02bc11a93cbf92a645045c7b..805aeb6f7ef335e017fa283b6145cd2890d611d0 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.
@@ -99,7 +99,7 @@ function (gmx_cpack_write_config)
     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")
+        "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})
index aef18bd15dff486fde7cc39f1ca05705b93646d4..42c27780c8da3d966fbf9d78e00ce38a4e6d6764 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.
 
-# Manage the Gromacs shared library setup.
+# Manage the GROMACS shared library setup.
 
 ########################################################################
 # Shared/static library settings
@@ -89,7 +89,7 @@ mark_as_advanced(GMX_PREFER_STATIC_LIBS)
 if (UNIX AND GMX_PREFER_STATIC_LIBS)
     if(BUILD_SHARED_LIBS)
         # Warn the user about the combination. But don't overwrite the request.
-        message(WARNING "Searching for static libraries requested, and building shared Gromacs libraries requested. This might cause problems linking later.")
+        message(WARNING "Searching for static libraries requested, and building shared GROMACS libraries requested. This might cause problems linking later.")
     endif()
     # On Linux .a is the static library suffix, on Mac OS X .lib can also
     # be used, so we'll add both to the preference list.
@@ -119,7 +119,7 @@ endfunction()
 IF( WIN32)
   if (NOT BUILD_SHARED_LIBS)
       if(NOT GMX_PREFER_STATIC_LIBS)
-          message(WARNING "Shared system libraries requested, and static Gromacs libraries requested.")
+          message(WARNING "Shared system libraries requested, and static GROMACS libraries requested.")
       endif()
   else()
       if(MINGW)
@@ -129,7 +129,7 @@ IF( WIN32)
       endif()
       if(GMX_PREFER_STATIC_LIBS)
           #this combination segfaults (illegal passing of file handles)
-          message(FATAL_ERROR "Static system libraries requested, and shared Gromacs libraries requested.")
+          message(FATAL_ERROR "Static system libraries requested, and shared GROMACS libraries requested.")
       endif()
       # Visibility not yet implemented
       # add_definitions(-DUSE_VISIBILITY -DTMPI_USE_VISIBILITY)
index 1d9eb220683e69286d2c573fa9dd6046aeee5013..2e04ed6e23c96a78e12ae0dd049a42d6452e208a 100644 (file)
@@ -61,7 +61,7 @@ set(GMX_SIMD_ACCURACY_BITS_SINGLE 22 CACHE STRING "Target mantissa bits for SIMD
 # and the first iteration can sometimes be done as a pair in single precision. This should
 # be plenty enough for Molecular Dynamics applications. Many of our double precision math
 # functions still achieve very close to full double precision, but we do not guarantee that
-# they will be able to achieve higher accuracy if you set this beyond 44 bits. Gromacs will
+# they will be able to achieve higher accuracy if you set this beyond 44 bits. GROMACS will
 # work - but some unit tests might fail.
 #
 set(GMX_SIMD_ACCURACY_BITS_DOUBLE 44 CACHE STRING "Target mantissa bits for SIMD double math")
@@ -226,7 +226,7 @@ int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_frcz_ps(x);return _mm_movemask_ps(x);
     gmx_test_avx_gcc_maskload_bug(GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG "${SIMD_C_FLAGS}")
 
     set(GMX_SIMD_X86_AVX_128_FMA 1)
-    set(SIMD_STATUS_MESSAGE "Enabling 128-bit AVX SIMD Gromacs SIMD (with fused-multiply add)")
+    set(SIMD_STATUS_MESSAGE "Enabling 128-bit AVX SIMD GROMACS SIMD (with fused-multiply add)")
 
 elseif(${GMX_SIMD} STREQUAL "AVX_256")
 
index 2748a2a4041c34bac9fc84f7b2f909ce0ce32314..1079ce276453716ce15875a8027485409a94f1e7 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.
@@ -77,7 +77,7 @@ macro(gmx_test_compiler_problems)
     endif()
 
     if (CMAKE_C_COMPILER_ID STREQUAL "PGI")
-        message(WARNING "All tested PGI compiler versions (up to 12.9.0) generate binaries which produce incorrect results, or even fail to  compile Gromacs. Highly recommended to use a different compiler. If you choose to use PGI, make sure to run the regressiontests.")
+        message(WARNING "All tested PGI compiler versions (up to 12.9.0) generate binaries which produce incorrect results, or even fail to  compile GROMACS. Highly recommended to use a different compiler. If you choose to use PGI, make sure to run the regressiontests.")
     endif()
 
     if(CMAKE_COMPILER_IS_GNUCC AND
index 9f4810910720ca46adac1f4008505c3fc66070a6..f2a3809d31e817b594ae7ce8b2c13e54f50868cf 100644 (file)
@@ -120,7 +120,6 @@ if (SPHINX_FOUND)
         dev-manual/tools.rst
         dev-manual/uncrustify.rst
         install-guide/index.rst
-        man/gromacs.7.rst
         user-guide/index.rst
         user-guide/getting-started.rst
         user-guide/flow.rst
@@ -175,6 +174,7 @@ if (SPHINX_FOUND)
     # TODO: Make this remove obsolete .rst files.
     gmx_add_custom_output_target(sphinx-programs OUTPUT STAMP
         COMMAND ${CMAKE_COMMAND} -E make_directory programs
+        COMMAND ${CMAKE_COMMAND} -E make_directory man
         COMMAND gmx -quiet help -export rst
         DEPENDS gmx
         WORKING_DIRECTORY ${SPHINX_INPUT_DIR}
index 8a63cd7c43ddd0008e65152cafe9d90733e6f3d7..8c903fcba6589961aa2fd2fdbac60adf3783b3af 100644 (file)
@@ -34,7 +34,7 @@
 
 # -*- coding: utf-8 -*-
 #
-# Gromacs documentation build configuration file, created by
+# GROMACS documentation build configuration file, created by
 # sphinx-quickstart on Tue Jan 13 14:28:44 2015.
 #
 # This file is execfile()d with the current directory set to its
@@ -163,7 +163,7 @@ rst_epilog += """
 .. _MKL: https://software.intel.com/en-us/intel-mkl
 .. _VMD: http://www.ks.uiuc.edu/Research/vmd/
 .. _PyMOL: http://www.pymol.org
-.. _continuous integration server used by Gromacs: http://jenkins.gromacs.org
+.. _continuous integration server used by GROMACS: http://jenkins.gromacs.org
 .. _Jenkins: http://jenkins-ci.org
 .. _webpage: http://www.gromacs.org
 .. _ftp site: ftp://ftp.gromacs.org/pub/gromacs/
@@ -273,8 +273,8 @@ latex_elements = {
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-  ('index', 'Gromacs.tex', u'Gromacs Documentation',
-   u'Gromacs development team', 'manual'),
+  ('index', 'Gromacs.tex', u'GROMACS Documentation',
+   u'GROMACS development team', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
@@ -314,8 +314,8 @@ execfile('conf-man.py')
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-  ('index', 'Gromacs', u'Gromacs Documentation',
-   u'Gromacs development team', 'Gromacs', 'One line description of project.',
+  ('index', 'GROMACS', u'GROMACS Documentation',
+   u'GROMACS development team', 'GROMACS', 'One line description of project.',
    'Miscellaneous'),
 ]
 
index d219c9568a72cd9018399f353c4143d4dd58a4bd..e2b624fb4b41cb13d227cce9dd1a88f983978c71 100644 (file)
@@ -79,7 +79,7 @@ module and documenting it.
 
   * Consistent usage of ::
 
-        #include "..." // This should be used for Gromacs headers
+        #include "..." // This should be used for GROMACS headers
 
     and ::
 
index 9c7da69f10a0f9a054f5257cce0c0990722204c7..15de98644641e125b2aac8ac81923f1048bf5bd1 100755 (executable)
@@ -338,7 +338,7 @@ def main():
     # version.
     parser.add_option('-s', '--style', type='choice', default='pub-priv',
                       choices=('single-group', 'pub-priv', 'pub-local'),
-                      help='Style for Gromacs includes')
+                      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()
index 144f3badf6b67d30266782e588678edec78ea696..ee5bb056c134df2d4b90990d3b2770e791e1f464 100644 (file)
@@ -136,12 +136,12 @@ This is the top-level wrapper that you should always include first.
 It will check the settings made at configuration time and include a
 suitable low-level implementation (that can be either single, double,
 or both). It also contains the routines for memory alignment, and
-based on the current Gromacs precision it will set aliases to 'real'
+based on the current \Gromacs precision it will set aliases to 'real'
 SIMD datatypes (see further down) so the implementations do not have
-to care about Gromacs-specific details. However, note that you might
-not get all SIMD support you hoped for: If you compiled Gromacs in
+to care about \Gromacs-specific details. However, note that you might
+not get all SIMD support you hoped for: If you compiled \Gromacs in
 double precision but the hardware only supports single-precision SIMD
-there will not be any SIMD routines for default Gromacs 'real' precision.
+there will not be any SIMD routines for default \Gromacs 'real' precision.
 There are \#defines you can use to check this, as described further down.
 </dd>
 <dt>`gromacs/simd/impl_reference.h`</dt>
@@ -162,7 +162,7 @@ algorithms if these features are present.
 <dd>
 This file contains a few rvec-related SIMD functions, e.g. to
 calculate scalar products, norms, or cross products. They obviously
-cannot operate on scalar Gromacs rvec types, but use separate SIMD
+cannot operate on scalar \Gromacs rvec types, but use separate SIMD
 variables for X,Y, and Z vector components.
 </dd>
 </dl>
@@ -216,7 +216,7 @@ integers too.
 <dl>
 <dt>`#gmx_simd_int32_t`</dt>
 <dd>
-This is used for integers when converting to/from Gromacs default "real" type.
+This is used for integers when converting to/from \Gromacs default "real" type.
 The corresponding routines have suffix `_i`, e.g. `gmx_simd_add_i()`.
 </dd>
 <dt>`gmx_simd_fint32_t`</dt>
@@ -309,7 +309,7 @@ the preprocessor macros described below.
 </dd>
 </dl>
 
-Operations on these types will be defined to either float/double (or corresponding integers) based on the current Gromacs precision, so the documentation is occasionally more detailed for the lower-level actual implementation functions.
+Operations on these types will be defined to either float/double (or corresponding integers) based on the current \Gromacs precision, so the documentation is occasionally more detailed for the lower-level actual implementation functions.
 
 SIMD4 Macros
 ------------
index fd8c81c5dd90b2760c74862fdb19c95e03028038..98f6fcc50d49f3488f91e2da8c77c78866297619 100644 (file)
@@ -97,6 +97,9 @@ The build system provides a target, `make sphinx-programs`, that generates
 reStructuredText help for the commands, which in turn is used to generate man
 and HTML help.  Internally, this executes `gmx help -export rst`, which
 triggers special handling in the internal help module.
+See documentation for
+\linktodevmanual{build-system,special targets in the build system} for details
+of which targets to use for generating the documentation..
 
 If this option is set, the help module loops through all the modules in the
 binary, writing help for each into a separate file.  The help module writes
@@ -107,8 +110,6 @@ using a different help context than for console output).
 Additionally, a list of all the modules is generated (`gromacs.7` for man
 pages, and alphabetical and by-topic lists for the HTML pages).
 
-TODO: Document/link to existing documentation for targets that use the rst help
-
 Handling C %main() functions {#section_wrapperbinary_cmain}
 ----------------------------
 
index 68d021b769de51eea3768830a24a681f41c1455f..8a984a817ed51de1132e8ffb45d15a060848e175 100644 (file)
@@ -52,6 +52,8 @@ give an overview of some of the topics that are documented:
  - \subpage page_analysisframework <br/>
    Provides an overview of the framework that the \Gromacs library provides for
    writing (trajectory) analysis tools.
+ - \subpage page_onlinehelp <br/>
+   Provides an overview of the formatting markup available in help texts.
  - \subpage page_usinglibrary <br/>
    Provides general guidance for writing software that uses the \Gromacs
    library.
diff --git a/docs/doxygen/user/onlinehelp.md b/docs/doxygen/user/onlinehelp.md
new file mode 100644 (file)
index 0000000..4c3e0ce
--- /dev/null
@@ -0,0 +1,115 @@
+Help formatting {#page_onlinehelp}
+===============
+
+Some parts of \Gromacs use in-source strings as a documentation source.  The
+most notable use of these is the description and options list printed out by
+the `-h` command line, and this case is exposed also to code that uses \Gromacs
+as a library to write command-line tools.  The help text is declared as an
+array of strings:
+
+    const char *const desc[] = {
+        "First paragraph.",
+        "",
+        "Second paragraph",
+        "with more text",
+        "and [TT]some formatting[tt].",
+    };
+
+The array variable is then passed to a function that exposes it as the help
+text.  Some of the help content is also generated based on, e.g., the list of
+options that the program declares.
+
+The same approach is also used internally in \Gromacs in a few other places.
+The same help text is used for console output (like in the `-h` case), as well
+as for producing reStructuredText.  The reStructuredText output is passed to
+Sphinx to produce a HTML user guide and Unix man pages.
+
+Formatting markup
+=================
+
+Partly due to historical reasons, the markup allowed within the help text is a
+mixture of reStructuredText and \Gromacs-specific markup.  The allowed
+formatting is currently not that extensive, but basic constructs should work.
+
+The general approach to formatting is that the text is written to
+reStructuredText as-is, after replacement of the \Gromacs-specific markup, with
+line breaks between each string in the input array.  This means that the commas
+at the end of each line (separating the strings) are critical for proper
+formatting.  This also means that any reStructuredText construct will appear
+correctly in the HTML and man pages (as long as the output format supports it).
+
+For console output, there input string is parsed for some basic
+reStructuredText constructs to be able to rewrap the text to the console width
+(currently fixed at 78 characters).  This parsing is one major constraint on
+what reStructuredText constructs can be used; paragraph-level markup that is
+not recognized by this parser results in messy console output.  Inline markup
+is currently not processed in any way, so any construct that renders reasonably
+in plain text can in principle be used.
+
+reStructuredText
+----------------
+
+The following reStructuredText constructs are recognized and work for console
+output:
+ - Paragraphs, i.e., blocks of text separated by an empty line.  Text within
+   each paragraph is wrapped separately, and indentation is preserved (as long
+   as the whole paragraph has the same indentation level, which is expected for
+   reStructuredText).  This means that block quotes are also rendered
+   reasonably, since they are just indented paragraphs.
+ - Literal blocks, i.e., indented paragraphs where the preceding paragraph ends
+   with `::`.  Line breaks within such paragraphs are preserved.  The rules for
+   handling the `::` are the same as in reStructuredText.
+   Multiple paragraphs within a literal block are not currently supported.
+ - Titles, i.e., a line underlined by a punctuation character.
+   Title formatting is currently preserved as-is, so it must be manually
+   ensured that the used punctuation character properly fits into the context
+   (i.e., other titles in the same generated reStructuredText document).
+   Titles with both under- and overline are not currently supported.
+ - Bullet lists.  Only lists that start with `*` are currently recognized.
+   Indentation for the second and subsequent lines is determined from
+   the first non-space character after the bullet and/or from the second line
+   in the input (if these are not the same, the minimum is used).
+   Note that in reStructuredText, the `*` must not be indented with respect to
+   the preceding paragraph; otherwise, the bullet list is rendered within a
+   block quote.  Also, an empty line needs to precede a bullet list.
+ - Enumerated lists.  Only lists that start with digits are supported (e.g.,
+   `1.`).  Multi-digit numbers can be used.
+   Indentation is determined as for bullet lists.
+   Lists are not renumbered automatically.
+
+\Gromacs-specific markup
+------------------------
+
+Markup within paragraphs is currently done with \Gromacs-specific constructs
+limited with brackets.  In the future, some of these may get replaced with more
+reStructuredText constructs.  The following are used:
+ - `[TT]`/`[tt]`: text between these tags is formatted in a monospace font.
+ - `[BB]`/`[bb]`: text between these tags is formatted in a bold font.
+ - `[IT]`/`[it]`: text between these tags is formatted in an italic font.
+ - `[MAG]`/`[mag]`: text between these tags is rendered between `|` (bar)
+   characters (which is a special character in reStructuredText).
+ - `[PAR]`: this is replaced by two newlines to produce a paragraph break.
+   For any new help text, an explicit empty line is preferred.
+Various other markup constructs, mainly related to math, are also used in some
+places, but currently these are always replaced with the same text irrespective
+of the output format, and a new approach is needed for proper math support.
+
+Additionally, the following replacements are possible (not necessarily in all
+contexts):
+ - `[REF]`/`[ref]`: replaced with a link to a section that describes the term
+   between these tags.  Only affects the reStructuredText output; the tags are
+   simply removed from console output.
+   The mechanism for managing these crosslinks would need additional work.
+ - `[THISMODULE]`: replaced with the name of the current module/command
+   (e.g., `gmx angle`).
+ - `[PROGRAM]`: replaced with the name of the current executable (e.g., `gmx`).
+
+\if libapi
+Implementation
+==============
+
+See \ref module_onlinehelp module documentation for implementation details.
+
+See \ref page_wrapperbinary for details of how the reStructuredText help is
+exported and processed further.
+\endif
diff --git a/docs/man/.gitignore b/docs/man/.gitignore
deleted file mode 100644 (file)
index a0e7b5c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-man1
-man7/gromacs.7
diff --git a/docs/man/gromacs.7.rst b/docs/man/gromacs.7.rst
deleted file mode 100644 (file)
index 5dd753b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-:orphan:
-
-GROMACS
-=======
-
-Description
------------
-
-**GROMACS** is a full-featured suite of programs to perform molecular dynamics
-simulations - in other words, to simulate the behavior of systems with hundreds
-to millions of particles, using Newtonian equations of motion.
-It is primarily used for research on proteins, lipids, and polymers, but can be
-applied to a wide variety of chemical and biological research questions.
-
-Synopsis
---------
-
-The following commands make up the GROMACS suite.  Please refer to their
-individual man pages for further details.
-
-.. include:: bytopic.rst
-
-Additional documentation
-------------------------
-
-Consult the manual at <http://www.gromacs.org> for an introduction to molecular
-dynamics in general and GROMACS in particular, as well as an overview of the
-individual programs.
-
-References
-----------
-
-The development of GROMACS is mainly funded by academic research grants.
-To help us fund development, the authors humbly ask that you cite the GROMACS papers:
-
-H.J.C. Berendsen, D. van der Spoel and R. van Drunen.  **GROMACS: A message-passing
-parallel molecular dynamics implementation**.  Comp. Phys. Comm. *91*, 43-56 (1995)
-
-Erik Lindahl, Berk Hess and David van der Spoel.  **GROMACS 3.0: A package for
-molecular simulation and trajectory analysis**.  J. Mol. Mod. *7*, 306-317 (2001)
-
-B. Hess, C. Kutzner, D. van der Spoel, and E. Lindahl.  **GROMACS 4: Algorithms for
-Highly Efficient, Load-Balanced, and Scalable Molecular Simulation**.
-J. Chem. Theory Comput. *4*, 3, 435-447 (2008),
-<http://dx.doi.org/10.1021/ct700301q>
-
-Authors
--------
-
-Current developers:
-
-David van der Spoel <spoel@gromacs.org>  
-Berk Hess <hess@gromacs.org>  
-Erik Lindahl <lindahl@gromacs.org>
-
-A full list of present and former contributors
-is available at <http://www.gromacs.org>
-
-This manual page is largely based on the GROMACS online reference, and the text
-was prepared originally by Nicholas Breen <nbreen@ofb.net>.
-
-Bugs
-----
-
-GROMACS has no major known bugs, but be warned that it stresses your CPU more
-than most software.  Systems with slightly flaky hardware may prove unreliable
-while running heavy-duty simulations.  If at all possible, please try to
-reproduce bugs on another machine before reporting them.
index 7ea3e25879c6a322d175ca5da887675ba104103f..a6ea937f0340eb5ba8bdc49d4e6d88a0556e7143 100644 (file)
@@ -1753,8 +1753,8 @@ but the half-step-averaged kinetic energy for the temperatures, which can be wri
 
 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
+constraint forces. Before {\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.
 
index cda68e83c8c9862a8c3d292c35585b8965a8c93c..4581dff496399c717668081673097307ce604ed1 100644 (file)
@@ -1,10 +1,10 @@
 Environment Variables
 =====================
 
-Gromacs programs may be influenced by the use of
+|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
+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
@@ -20,7 +20,7 @@ Output Control
         Print constraint virial and force virial energy terms.
 
 ``GMX_MAXBACKUP``
-        Gromacs automatically backs up old
+        |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
@@ -48,7 +48,7 @@ Output Control
         ``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).
+        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.
 
index 667ff7284b531f587f8326be0d3da4b527b13930..bdadf4723885efd0863e76219f8878dea2d156af 100644 (file)
@@ -285,7 +285,7 @@ Lines contain the following information (top to bottom):
  * box vectors (free format, space separated reals), values:
    v1(x) v2(y) v3(z) v1(y) v1(z) v2(x) v2(z) v3(x) v3(y),
    the last 6 values may be omitted (they will be set to zero).
-   Gromacs only supports boxes with v1(y)=v1(z)=v2(z)=0.
+   |Gromacs| only supports boxes with v1(y)=v1(z)=v2(z)=0.
 
 This format is fixed, ie. all columns are in a fixed
 position. Optionally (for now only yet with trjconv) you can write gro
index 5c325d76571769860df919982ce63f764d9339ae..f173b661f6b1df998515807f9a1d898c2d5ff2e5 100644 (file)
@@ -37,7 +37,7 @@ 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 for
-:ref:`getting access to Gromacs`.
+:ref:`getting access to GROMACS`.
 
 Flowchart of typical simulation
 -------------------------------
index 84e9323ca72bf95303031438b4205342eb18233d..05c93595fd8e01790d1cab33fd14a54955d3d955 100644 (file)
@@ -1,4 +1,4 @@
-# This is a Gromacs template makefile for your own utility programs using pkg-config.
+# This is a GROMACS template makefile for your own utility programs using pkg-config.
 #
 # Copy this file to whatever directory you are using for your own software
 #
index fe925a88b3b4f04e77d4100f683966c4df765b45..6ef9e466b5764566615f7be8b006efbea087ec71 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.
@@ -87,10 +87,10 @@ AnalysisTemplate::initOptions(Options                    *options,
 {
     static const char *const desc[] = {
         "This is a template for writing your own analysis tools for",
-        "Gromacs. The advantage of using Gromacs for this is that you",
+        "GROMACS. The advantage of using GROMACS for this is that you",
         "have access to all information in the topology, and your",
         "program will be able to handle all types of coordinates and",
-        "trajectory files supported by Gromacs. In addition,",
+        "trajectory files supported by GROMACS. In addition,",
         "you get a lot of functionality for free from the trajectory",
         "analysis library, including support for flexible dynamic",
         "selections. Go ahead an try it![PAR]",
index 65efae39614a8ff4417565dcd24c9d51e5e62ebc..c10a49811a7fc692fea8de572aedc84adcbe0567 100644 (file)
@@ -1,4 +1,4 @@
-530
+586
 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)
@@ -529,5 +529,59 @@ But I always say, one's company, two's a crowd, and three's a party._(Andy Warho
 We'll celebrate a woman for anything, as long as it's not her talent._(Colleen McCullough)
 I believe the big bang of self-driving cars is about to come._(Jen-Hsun Huang, CEO NVIDIA)
 This is where we have been working hard to push down performance._(Szilard Pall, GTC 2015 talk)
-
-
+Some of these pro-drug messages come from popular culture._(John Walters)
+Don't pay any attention to what they write about you. Just measure it in inches._(Andy Warhol)
+Art is what you can get away with._(Andy Warhol)
+I spent a lot of money on booze, birds and fast cars. The rest I just squandered._(George Best)
+The only greatness for man is immortality._(James Dean)
+Do not quench your inspiration and your imagination; do not become the slave of your model._(Vincent Van Gogh)
+You always pass failure on the way to success._(Mickey Rooney)
+I always seem to get inspiration and renewed vitality by contact with this great novel land of yours which sticks up out of the Atlantic._(Winston Churchill)
+I am at two with nature._(Woody Allen)
+I'm no model lady. A model's just an imitation of the real thing._(Mae West)
+Science is the great antidote to the poison of enthusiasm and superstition._(Adam Smith, Wealth of Nations, 1776)
+Science is a wonderful thing if one does not have to earn one's living at it._(Albert Einstein)
+Science is the record of dead religions._(Oscar Wilde)
+Physics isn't a religion. If it were, we'd have a much easier time raising money._(Leon Lederman)
+It is now quite lawful for a Catholic woman to avoid pregnancy by a resort to mathematics, though she is still forbidden to resort to physics and chemistry._(Henry Louis Mencken)
+An expert is a person who has made all the mistakes that can be made in a very narrow field._(Niels Bohr)
+In my opinion, we don't devote nearly enough scientific research to finding a cure for jerks._(Bill Watterson)
+Scientists do not join hands every Sunday and sing "Yes gravity is real! I know gravity is real! I will have faith! I believe in my heart that what goes up, up, up must come down, down, down. Amen!" If they did, we would think they were pretty insecure about the concept._(Dan Barker)
+Take away paradox from the thinker and you have a professor._(Soren Kirkegaard)
+Measuring programming progress by lines of code is like measuring aircraft building progress by weight._(Bill Gates)
+Protons give an atom its identity, electrons its personality._(Bill Bryson)
+Money won't buy happiness, but it will pay the salaries of a large research staff to study the problem._(Bill Vaughan)
+Torture numbers, and they'll confess to anything._(Greg Easterbrook)
+Should we force science down the throats of those that have no taste for it? Is it our duty to drag them kicking and screaming into the twenty-first century? I am afraid that it is._(George Porter)
+A computer would deserve to be called intelligent if it could deceive a human into believing that it was human._(Alan Turing)
+Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin._(John von Neumann)
+No, no, you're not thinking, you're just being logical._(Niels Bohr)
+As an adolescent I aspired to lasting fame, I craved factual certainty, and I thirsted for a meaningful vision of human life -- so I became a scientist. This is like becoming an archbishop so you can meet girls._(Matt Cartmill)
+Problems worthy / of attack / prove their worth / by hitting back._(Piet Hein)
+Naive you are if you believe life favours those who aren't naive._(Piet Hein)
+Never measure the height of a mountain until you have reached the top. Then you will see how low it was._(Dag Hammarskjold)
+Praise those of your critics for whom nothing is up to standard._(Dag Hammarskjold)
+Inventions have long since reached their limit, and I see no hope for further development._(Julius Sextus Frontinus, 1st century A.D.)
+Lottery: A tax on people who are bad at math._(Ambrose Bierce)
+Even if you are on the right track, you will get run over if you just sit there._(Will Rogers)
+Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning._(Rick Cook)
+There's a limit to how many times you can read how great you are and what an inspiration you are, but I'm not there yet._(Randy Pausch)
+Throughout my academic career, I'd given some pretty good talks. But being considered the best speaker in the computer science department is like being known as the tallest of the Seven Dwarfs._(Randy Pausch)
+If everything seems under control, you're just not going fast enough._(Mario Andretti)
+Sincerity is the key to success. Once you can fake that you’ve got it made._(Groucho Marx)
+This work contains many things which are new and interesting. Unfortunately, everything that is new is not interesting, and everything which is interesting, is not new._(Lev Landau)
+Does college pay? They do if you are a good open-field runner._(Will Rogers)
+Academe, n.: An ancient school where morality and philosophy were taught. Academy, n.: A modern school where football is taught._(Ambrose Bierce)
+This simulation is not as the former._(Malvolio, Act II, scene V of Shaphespeare's Twelfth Night)
+Here, kitty, kitty..._(Erwin Schroedinger)
+Sir, spare your threats: The bug which you would fright me with I seek._(Hermione, Act III, scene II of Shakespeare's Winter's Tale)
+Erwin with his psi can do / Calculations quite a few. / But one thing has not been seen / Just what psi really mean._(Felix Bloch)
+Only entropy comes easy._(Anton Chekov)
+The lovliest theories are being overthrown by these damned experiments; it is no fun being a chemist any more._(Justus von Liebig, letter to J.J. Berzelius 1834)
+If all else fails, immortality can always be assured by spectacular error._(John Kenneth Galbraith)
+Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live._(Martin Golding)
+If I have not seen as far as others, it is because giants were standing on my shoulders._(Hal Abelson)
+Weaseling out of things is important to learn. It's what separates us from the animals... except the weasels._(Homer Simpson)
+In science, truth always wins._(Max Perutz)
+Creativity in science, as in art, cannot be organized. It arises spontaneously from individual talent. Well-run laboratories can foster it, but hierarchical organizations, inflexible bureaucratic rules, and mountains of futile paperwork can kill it._(Max Perutz)
+Every electron is sacred._(Greg McMullan, on Cryo-EM detectors)
index b1b3e037e78721dd0bfac956de53f876a465c5ac..7e4bd8166375da517463fe174ebe0b68d2472dda 100644 (file)
@@ -8,4 +8,4 @@ To add a program, you should edit CMakeLists.txt.
 
 
 
-                   The Gromacs Crew
\ No newline at end of file
+                   The GROMACS     Crew
\ No newline at end of file
index e32e337cb22df32327268b1c15ad7432364b1565..db58fec1040cd9efb60b1afae1e7c9d046b62092 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/onlinehelp/helpwritercontext.h"
 #include "gromacs/options/basicoptions.h"
 #include "gromacs/options/options.h"
+#include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/baseversion.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
@@ -88,7 +89,7 @@ class CommandLineHelpModuleImpl
                                   const CommandLineModuleMap       &modules,
                                   const CommandLineModuleGroupList &groups);
 
-        void exportHelp(HelpExportInterface *exporter) const;
+        void exportHelp(HelpExportInterface *exporter);
 
         boost::scoped_ptr<RootHelpTopic>  rootTopic_;
         const ProgramContextInterface    &programContext_;
@@ -188,22 +189,29 @@ class HelpExportInterface
 
 struct RootHelpText
 {
-    static const char        name[];
     static const char        title[];
     static const char *const text[];
 };
 
-// The first two are not used.
-const char        RootHelpText::name[]  = "";
-const char        RootHelpText::title[] = "";
-const char *const RootHelpText::text[]  = { "" };
+// These are used for the gmx.1 man page.
+// TODO: Do not hardcode them here, but pass them from the outside to make this
+// code more generic.
+const char        RootHelpText::title[] = "molecular dynamics simulation suite";
+const char *const RootHelpText::text[]  = {
+    "|Gromacs| is a full-featured suite of programs to perform molecular",
+    "dynamics simulations, i.e., to simulate the behavior of systems with",
+    "hundreds to millions of particles using Newtonian equations of motion.",
+    "It is primarily used for research on proteins, lipids, and polymers, but",
+    "can be applied to a wide variety of chemical and biological research",
+    "questions.",
+};
 
 /*! \brief
  * Help topic that forms the root of the help tree for the help subcommand.
  *
  * \ingroup module_commandline
  */
-class RootHelpTopic : public CompositeHelpTopic<RootHelpText>
+class RootHelpTopic : public AbstractCompositeHelpTopic
 {
     public:
         /*! \brief
@@ -216,6 +224,9 @@ class RootHelpTopic : public CompositeHelpTopic<RootHelpText>
         {
         }
 
+        virtual const char *name() const { return helpModule_.binaryName_.c_str(); }
+        virtual const char *title() const { return title_.c_str(); }
+
         //! Adds a top-level topic and optionally marks it as exported.
         void addTopic(HelpTopicPointer topic, bool bExported)
         {
@@ -226,18 +237,22 @@ class RootHelpTopic : public CompositeHelpTopic<RootHelpText>
             addSubTopic(move(topic));
         }
         //! Exports all the top-level topics with the given exporter.
-        void exportHelp(HelpExportInterface *exporter) const;
+        void exportHelp(HelpExportInterface *exporter);
 
         virtual void writeHelp(const HelpWriterContext &context) const;
 
     private:
+        // unused because of the writeHelp() override
+        virtual std::string helpText() const { return ""; }
+
         const CommandLineHelpModuleImpl  &helpModule_;
+        std::string                       title_;
         std::vector<std::string>          exportedTopics_;
 
         GMX_DISALLOW_COPY_AND_ASSIGN(RootHelpTopic);
 };
 
-void RootHelpTopic::exportHelp(HelpExportInterface *exporter) const
+void RootHelpTopic::exportHelp(HelpExportInterface *exporter)
 {
     std::vector<std::string>::const_iterator topicName;
     for (topicName = exportedTopics_.begin();
@@ -248,33 +263,55 @@ void RootHelpTopic::exportHelp(HelpExportInterface *exporter) const
         GMX_RELEASE_ASSERT(topic != NULL, "Exported help topic no longer found");
         exporter->exportTopic(*topic);
     }
+    // For now, the title is only set for the export to make it not appear in
+    // console output, which makes things consistent for 'gmx help' and
+    // 'gmx help <command>'.
+    title_ = RootHelpText::title;
+    exporter->exportTopic(*this);
 }
 
 void RootHelpTopic::writeHelp(const HelpWriterContext &context) const
 {
-    if (context.outputFormat() != eHelpOutputFormat_Console)
-    {
-        // TODO: Implement once the situation with Redmine issue #969 is more
-        // clear.
-        GMX_THROW(NotImplementedError(
-                          "Root help is not implemented for this output format"));
-    }
     {
-        CommandLineCommonOptionsHolder optionsHolder;
-        CommandLineHelpContext         cmdlineContext(*helpModule_.context_);
-        cmdlineContext.setModuleDisplayName(helpModule_.binaryName_);
+        CommandLineCommonOptionsHolder            optionsHolder;
+        boost::scoped_ptr<CommandLineHelpContext> cmdlineContext;
+        if (helpModule_.context_ != NULL)
+        {
+            cmdlineContext.reset(new CommandLineHelpContext(*helpModule_.context_));
+        }
+        else
+        {
+            cmdlineContext.reset(new CommandLineHelpContext(context));
+        }
+        cmdlineContext->setModuleDisplayName(helpModule_.binaryName_);
         optionsHolder.initOptions();
+        Options &options = *optionsHolder.options();
+        options.setDescription(RootHelpText::text);
         // TODO: Add <command> [<args>] into the synopsis.
-        CommandLineHelpWriter(*optionsHolder.options())
-            .writeHelp(cmdlineContext);
+        CommandLineHelpWriter(options)
+            .setShowDescriptions(context.outputFormat() != eHelpOutputFormat_Console)
+            .writeHelp(*cmdlineContext);
+    }
+    if (context.outputFormat() == eHelpOutputFormat_Console)
+    {
+        // TODO: Consider printing a list of "core" commands. Would require someone
+        // to determine such a set...
+        writeSubTopicList(context,
+                          "Additional help is available on the following topics:");
+        // TODO: Make these respect the binary name passed in, to make tests work better.
+        context.writeTextBlock("To access the help, use '[PROGRAM] help <topic>'.");
+        context.writeTextBlock("For help on a command, use '[PROGRAM] help <command>'.");
+    }
+    else
+    {
+        context.writeTitle(formatString("%s commands", helpModule_.binaryName_.c_str()));
+        context.writeTextBlock(
+                "The following commands are available. Please refer to their "
+                "individual man pages or [TT][PROGRAM] help <command>[tt] "
+                "for further details.");
+        context.writeTextBlock("");
+        context.writeTextBlock(".. include:: /man/bytopic.rst");
     }
-    // TODO: Consider printing a list of "core" commands. Would require someone
-    // to determine such a set...
-    writeSubTopicList(context,
-                      "Additional help is available on the following topics:");
-    // TODO: Make these respect the binary name passed in, to make tests work better.
-    context.writeTextBlock("To access the help, use '[PROGRAM] help <topic>'.");
-    context.writeTextBlock("For help on a command, use '[PROGRAM] help <command>'.");
 }
 
 /********************************************************************
@@ -472,6 +509,7 @@ class HelpExportReStructuredText : public HelpExportInterface
 
     private:
         FileOutputRedirectorInterface  *outputRedirector_;
+        const std::string              &binaryName_;
         HelpLinks                       links_;
         boost::scoped_ptr<File>         indexFile_;
         boost::scoped_ptr<File>         manPagesFile_;
@@ -480,6 +518,7 @@ class HelpExportReStructuredText : public HelpExportInterface
 HelpExportReStructuredText::HelpExportReStructuredText(
         const CommandLineHelpModuleImpl &helpModule)
     : outputRedirector_(helpModule.outputRedirector_),
+      binaryName_(helpModule.binaryName_),
       links_(eHelpOutputFormat_Rst)
 {
     File             linksFile("links.dat", "r");
@@ -515,7 +554,7 @@ void HelpExportReStructuredText::exportModuleHelp(
     // This would make Sphinx reruns much faster.
     File file(outputRedirector_->openFileForWriting("programs/" + tag + ".rst"));
     file.writeLine(formatString(".. _%s:", displayName.c_str()));
-    if (0 == displayName.compare("gmx mdrun"))
+    if (0 == displayName.compare(binaryName_ + " mdrun"))
     {
         // Make an extra link target for the convenience of
         // MPI-specific documentation
@@ -534,7 +573,7 @@ void HelpExportReStructuredText::exportModuleHelp(
     file.writeLine("   See also");
     file.writeLine("   --------");
     file.writeLine();
-    file.writeLine("   :manpage:`gromacs(7)`");
+    file.writeLine(formatString("   :manpage:`%s(1)`", binaryName_.c_str()));
     file.writeLine();
     file.writeLine("   More information about |Gromacs| is available at <http://www.gromacs.org/>.");
     file.close();
@@ -551,7 +590,11 @@ void HelpExportReStructuredText::finishModuleExport()
 {
     indexFile_->close();
     indexFile_.reset();
-    manPagesFile_->writeLine("    ('man/gromacs.7', 'gromacs', 'molecular dynamics simulation suite', '', 7)");
+    // TODO: Generalize.
+    manPagesFile_->writeLine(
+            formatString("    ('programs/%s', '%s', '%s', '', 1)",
+                         binaryName_.c_str(), binaryName_.c_str(),
+                         RootHelpText::title));
     manPagesFile_->writeLine("]");
     manPagesFile_->close();
     manPagesFile_.reset();
@@ -574,7 +617,7 @@ void HelpExportReStructuredText::exportModuleGroup(
     indexFile_->writeLine(title);
     indexFile_->writeLine(std::string(std::strlen(title), '-'));
     manPagesFile_->writeLine(title);
-    manPagesFile_->writeLine(std::string(std::strlen(title), '+'));
+    manPagesFile_->writeLine(std::string(std::strlen(title), '^'));
 
     ModuleGroupContents::const_iterator module;
     for (module = modules.begin(); module != modules.end(); ++module)
@@ -590,8 +633,8 @@ void HelpExportReStructuredText::exportModuleGroup(
         indexFile_->writeLine(formatString("| :doc:`%s <%s>` - %s",
                                            displayName.c_str(), tag.c_str(),
                                            module->second));
-        manPagesFile_->writeLine(formatString("| ``%s`` - %s",
-                                              displayName.c_str(),
+        manPagesFile_->writeLine(formatString(":manpage:`%s(1)`\n  %s",
+                                              tag.c_str(),
                                               module->second));
     }
     indexFile_->writeLine();
@@ -611,6 +654,11 @@ void HelpExportReStructuredText::exportTopic(const HelpTopicInterface &topic)
     const std::string path("programs/" + std::string(topic.name()) + ".rst");
     File              file(outputRedirector_->openFileForWriting(path));
     HelpWriterContext context(&file, eHelpOutputFormat_Rst, &links_);
+    if (topic.name() == binaryName_)
+    {
+        context.writeTextBlock(":orphan:");
+        context.writeTextBlock("");
+    }
     HelpManager       manager(topic, context);
     manager.writeCurrentTopic();
 }
@@ -701,7 +749,7 @@ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl(
 {
 }
 
-void CommandLineHelpModuleImpl::exportHelp(HelpExportInterface *exporter) const
+void CommandLineHelpModuleImpl::exportHelp(HelpExportInterface *exporter)
 {
     // TODO: Would be nicer to have the file names supplied by the build system
     // and/or export a list of files from here.
@@ -807,22 +855,20 @@ int CommandLineHelpModule::run(int argc, char *argv[])
         return 0;
     }
 
-    File &outputFile = impl_->outputRedirector_->standardOutput();
-    HelpLinks                                 links(eHelpOutputFormat_Console);
+    File                  &outputFile = impl_->outputRedirector_->standardOutput();
+    HelpLinks              links(eHelpOutputFormat_Console);
     initProgramLinks(&links, *impl_);
-    boost::scoped_ptr<CommandLineHelpContext> context(
-            new CommandLineHelpContext(&outputFile,
-                                       eHelpOutputFormat_Console, &links));
-    context->setShowHidden(impl_->bHidden_);
+    CommandLineHelpContext context(&outputFile, eHelpOutputFormat_Console, &links);
+    context.setShowHidden(impl_->bHidden_);
     if (impl_->moduleOverride_ != NULL)
     {
-        context->setModuleDisplayName(impl_->programContext_.displayName());
-        impl_->moduleOverride_->writeHelp(*context);
+        context.setModuleDisplayName(impl_->programContext_.displayName());
+        impl_->moduleOverride_->writeHelp(context);
         return 0;
     }
-    impl_->context_ = context.get();
+    impl_->context_ = &context;
 
-    HelpManager helpManager(*impl_->rootTopic_, context->writerContext());
+    HelpManager helpManager(*impl_->rootTopic_, context.writerContext());
     try
     {
         for (int i = 1; i < argc; ++i)
index 06dfbd53d5b26429b08ae34b887e4a7fbd2cb5d7..788991565a568be7469f4f055d455342f2646cd4 100644 (file)
@@ -629,13 +629,7 @@ void CommandLineHelpWriter::Impl::formatBugs(const HelpWriterContext &context)
     for (i = bugs_.begin(); i != bugs_.end(); ++i)
     {
         const char *const       bug = *i;
-        TextLineWrapperSettings settings;
-        settings.setIndent(2);
-        settings.setFirstLineIndent(0);
-        settings.setLineLength(78);
-        context.outputFile().writeLine(
-                context.substituteMarkupAndWrapToString(
-                        settings, formatString("* %s", bug)));
+        context.writeTextBlock(formatString("* %s", bug));
     }
 }
 
index 7ad92f536e7b2f713d29282512a7019436a7ab99..dbb0ffa7ca43995fbc279ca7ffe0e18fa83157c5 100644 (file)
@@ -13,7 +13,7 @@ man_pages = [
     ('programs/test-help', 'test-help', "Print help information", '', 1),
     ('programs/test-module', 'test-module', "First module", '', 1),
     ('programs/test-other', 'test-other', "Second module", '', 1),
-    ('man/gromacs.7', 'gromacs', 'molecular dynamics simulation suite', '', 7)
+    ('programs/test', 'test', 'molecular dynamics simulation suite', '', 1)
 ]
 ]]></String>
   <String Name="programs/test-help.rst"><![CDATA[
@@ -27,7 +27,7 @@ test help
    See also
    --------
 
-   :manpage:`gromacs(7)`
+   :manpage:`test(1)`
 
    More information about |Gromacs| is available at <http://www.gromacs.org/>.
 ]]></String>
@@ -60,7 +60,7 @@ Other options:
    See also
    --------
 
-   :manpage:`gromacs(7)`
+   :manpage:`test(1)`
 
    More information about |Gromacs| is available at <http://www.gromacs.org/>.
 ]]></String>
@@ -81,7 +81,7 @@ Synopsis
    See also
    --------
 
-   :manpage:`gromacs(7)`
+   :manpage:`test(1)`
 
    More information about |Gromacs| is available at <http://www.gromacs.org/>.
 ]]></String>
@@ -99,12 +99,14 @@ Group 2
 ]]></String>
   <String Name="man/bytopic.rst"><![CDATA[
 Group 1
-+++++++
-| ``test module`` - First module
+^^^^^^^
+:manpage:`test-module(1)`
+  First module
 
 Group 2
-+++++++
-| ``test other`` - Second module
+^^^^^^^
+:manpage:`test-other(1)`
+  Second module
 
 ]]></String>
   <String Name="programs/topic1.rst"><![CDATA[
@@ -128,5 +130,49 @@ Sub text
 Another topic
 =============
 Help text
+]]></String>
+  <String Name="programs/test.rst"><![CDATA[
+:orphan:
+
+molecular dynamics simulation suite
+===================================
+Synopsis
+--------
+::
+
+    test [-[no]h] [-[no]quiet] [-[no]version] [-[no]copyright] [-nice <int>]
+         [-[no]backup]
+
+Description
+-----------
+|Gromacs| is a full-featured suite of programs to perform molecular
+dynamics simulations, i.e., to simulate the behavior of systems with
+hundreds to millions of particles using Newtonian equations of motion.
+It is primarily used for research on proteins, lipids, and polymers, but
+can be applied to a wide variety of chemical and biological research
+questions.
+
+Options
+-------
+Other options:
+
+``-[no]h``  (no)
+    Print help and quit
+``-[no]quiet``  (no)
+    Do not print common startup info or quotes
+``-[no]version``  (no)
+    Print extended version information and quit
+``-[no]copyright``  (yes)
+    Print copyright information on startup
+``-nice`` <int> (19)
+    Set the nicelevel (default depends on command)
+``-[no]backup``  (yes)
+    Write backups if output files exist
+
+test commands
+-------------
+The following commands are available. Please refer to their individual man pages or ``commandline-test help <command>`` for further details.
+
+.. include:: /man/bytopic.rst
 ]]></String>
 </ReferenceData>
index 9839291218526b1bbfa188a44f7795ec8d5bfc73..0a86fa9c23f8622eb771487e7d9d8850f35740b6 100644 (file)
@@ -3,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.
@@ -579,7 +579,7 @@ double *dp;
             printf("Error when detecting floating-point word order.\n"
                    "Do you have a non-IEEE system?\n"
                    "If possible, use the XDR libraries provided with your system,\n"
-                   "instead of the Gromacs fallback XDR source.\n");
+                   "instead of the GROMACS fallback XDR source.\n");
             exit(0);
         }
     }
index f2a27e0eaffec0c879a850eea83ad97d229299be..c36f464815f1b99c2fa8ad16dbab21183f60c9cf 100644 (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.
@@ -183,7 +183,7 @@ gmx_mtxio_read (const char *            filename,
     {
         gmx_fatal(FARGS,
                   "No matrix data found in file. Note that the Hessian matrix format changed\n"
-                  "in Gromacs 3.3 to enable portable files and sparse matrix storage.\n");
+                  "in GROMACS 3.3 to enable portable files and sparse matrix storage.\n");
     }
 
     /* Read generating Gromacs version */
@@ -200,7 +200,7 @@ gmx_mtxio_read (const char *            filename,
     }
     gmx_fio_do_int(fio, prec);
 
-    fprintf(stderr, "Reading %s precision matrix generated by Gromacs %s\n",
+    fprintf(stderr, "Reading %s precision matrix generated by GROMACS %s\n",
             (prec == 1) ? "double" : "single", gmxver);
 
     gmx_fio_do_int(fio, i);
index e3defd42f6eaea46bce8de1678738e0297710fe1..84efd2070b36912dc0b2ee8c2854030700cffd76 100644 (file)
@@ -3228,7 +3228,7 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
         if (strncmp(buf, "VERSION", 7))
         {
             gmx_fatal(FARGS, "Can not read file %s,\n"
-                      "             this file is from a Gromacs version which is older than 2.0\n"
+                      "             this file is from a GROMACS version which is older than 2.0\n"
                       "             Make a new one with grompp or use a gro or pdb file, if possible",
                       gmx_fio_getname(fio));
         }
index 621160a9e8f91fe49085b0e71be53b01d8c1eb43..8533c243f6de985008918c5579ed5cb4be540e76 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,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.
@@ -325,7 +325,7 @@ static int load_vmd_library(const char *fn, t_gmxvmdplugin *vmdplugin)
         printf("\nNo VMD Plugins found\n"
                "Set the environment variable VMD_PLUGIN_PATH to the molfile folder within the\n"
                "VMD installation.\n"
-               "The architecture (e.g. 32bit versus 64bit) of Gromacs and VMD has to match.\n");
+               "The architecture (e.g. 32bit versus 64bit) of GROMACS and VMD has to match.\n");
         return 0;
     }
     for (i = 0; i < globbuf.gl_pathc && vmdplugin->api == NULL; i++)
index 102e79f2e0e552aee18d2b18f03c9b1f6f0e034e..9f1ae46c1477189b0b37042259d419c287639b42 100644 (file)
@@ -995,9 +995,11 @@ int gmx_anaeig(int argc, char *argv[])
         "when writing a [REF].pdb[ref] file with two or three structures (you",
         "can use [TT]rasmol -nmrpdb[tt] to view such a [REF].pdb[ref] file).[PAR]",
 
-        "  Overlap calculations between covariance analysis:[BR]",
-        "  [BB]Note:[bb] the analysis should use the same fitting structure[PAR]",
-
+        "Overlap calculations between covariance analysis",
+        "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
+        "",
+        "[BB]Note:[bb] the analysis should use the same fitting structure",
+        "",
         "[TT]-over[tt]: calculate the subspace overlap of the eigenvectors in",
         "file [TT]-v2[tt] with eigenvectors [TT]-first[tt] to [TT]-last[tt]",
         "in file [TT]-v[tt].[PAR]",
index ef83a98a784bece17bfb3943fb9cb708c84c6385..fb452e963ffabea20eee41ea549a7f9c4db909c9 100644 (file)
@@ -565,7 +565,7 @@ int gmx_density(int argc, char *argv[])
         "of an arbitrary group, in absolute box coordinates. If you are calculating",
         "profiles along the Z axis box dimension bZ, output would be from -bZ/2 to",
         "bZ/2 if you center based on the entire system.",
-        "Note that this behaviour has changed in Gromacs 5.0; earlier versions",
+        "Note that this behaviour has changed in GROMACS 5.0; earlier versions",
         "merely performed a static binning in (0,bZ) and shifted the output. Now",
         "we compute the center for each frame and bin in (-bZ/2,bZ/2).[PAR]",
 
@@ -598,7 +598,7 @@ int gmx_density(int argc, char *argv[])
         "The first problem that while both proteins and lipids have low volume",
         "compressibility, lipids have quite high area compressiblity. This means the",
         "shape of the box (thickness and area/lipid) will fluctuate substantially even",
-        "for a fully relaxed system. Since Gromacs places the box between the origin",
+        "for a fully relaxed system. Since GROMACS places the box between the origin",
         "and positive coordinates, this in turn means that a bilayer centered in the",
         "box will move a bit up/down due to these fluctuations, and smear out your",
         "profile. The easiest way to fix this (if you want pressure coupling) is",
index 89db7f316e087c8d76bd94d86c55b77cd36485d5..3b3c86cd42d40d94fd2c8ea157d09d3344ce8a19 100644 (file)
@@ -1874,15 +1874,18 @@ int gmx_energy(int argc, char *argv[])
         "Some fluctuation-dependent properties can be calculated provided",
         "the correct energy terms are selected, and that the command line option",
         "[TT]-fluct_props[tt] is given. The following properties",
-        "will be computed:[BR]",
-        "Property                        Energy terms needed[BR]",
-        "---------------------------------------------------[BR]",
-        "Heat capacity C[SUB]p[sub] (NPT sims):    Enthalpy, Temp     [BR]",
-        "Heat capacity C[SUB]v[sub] (NVT sims):    Etot, Temp         [BR]",
-        "Thermal expansion coeff. (NPT): Enthalpy, Vol, Temp[BR]",
-        "Isothermal compressibility:     Vol, Temp          [BR]",
-        "Adiabatic bulk modulus:         Vol, Temp          [BR]",
-        "---------------------------------------------------[BR]",
+        "will be computed:",
+        "",
+        "===============================  ===================",
+        "Property                         Energy terms needed",
+        "===============================  ===================",
+        "Heat capacity C[SUB]p[sub] (NPT sims):    Enthalpy, Temp",
+        "Heat capacity C[SUB]v[sub] (NVT sims):    Etot, Temp",
+        "Thermal expansion coeff. (NPT):  Enthalpy, Vol, Temp",
+        "Isothermal compressibility:      Vol, Temp",
+        "Adiabatic bulk modulus:          Vol, Temp",
+        "===============================  ===================",
+        "",
         "You always need to set the number of molecules [TT]-nmol[tt].",
         "The C[SUB]p[sub]/C[SUB]v[sub] computations do [BB]not[bb] include any corrections",
         "for quantum effects. Use the [gmx-dos] program if you need that (and you do).[PAR]"
@@ -2141,7 +2144,7 @@ int gmx_energy(int argc, char *argv[])
                 strcat(buf, ")");
             }
         }
-        out = xvgropen(opt2fn("-o", NFILE, fnm), "Gromacs Energies", "Time (ps)", buf,
+        out = xvgropen(opt2fn("-o", NFILE, fnm), "GROMACS Energies", "Time (ps)", buf,
                        oenv);
 
         snew(leg, nset+1);
index 9780027dd6448d7bad708d6593db57dc0da1529e..45adaa478390379a7790614709567b7c77062e74 100644 (file)
@@ -3,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.
@@ -74,8 +74,8 @@ int gmx_principal(int argc, char *argv[])
 {
     const char     *desc[] = {
         "[THISMODULE] calculates the three principal axes of inertia for a group",
-        "of atoms. NOTE: Old versions of Gromacs wrote the output data in a",
-        "strange transposed way. As of Gromacs-5.0, the output file paxis1.dat",
+        "of atoms. NOTE: Old versions of GROMACS wrote the output data in a",
+        "strange transposed way. As of GROMACS 5.0, the output file paxis1.dat",
         "contains the x/y/z components of the first (major) principal axis for",
         "each frame, and similarly for the middle and minor axes in paxis2.dat",
         "and paxis3.dat."
index 600608d2e322611aba964abde422bf08db57bc9b..beeaf0d0e86b14fdcef437a7f9e86c48d52d8d13 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 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.
@@ -54,43 +54,53 @@ static const double bohr = 0.529177249;  /* conversion factor to compensate for
 int gmx_spatial(int argc, char *argv[])
 {
     const char     *desc[] = {
-        "[THISMODULE] calculates the spatial distribution function and ",
-        "outputs it in a form that can be read by VMD as Gaussian98 cube format. ",
-        "For a system of 32,000 atoms and a 50 ns trajectory, the SDF can be generated ",
-        "in about 30 minutes, with most of the time dedicated to the two runs through ",
-        "[TT]trjconv[tt] that are required to center everything properly. ",
-        "This also takes a whole bunch of space (3 copies of the trajectory file). ",
-        "Still, the pictures are pretty and very informative when the fitted selection is properly made. ",
-        "3-4 atoms in a widely mobile group (like a free amino acid in solution) works ",
-        "well, or select the protein backbone in a stable folded structure to get the SDF ",
-        "of solvent and look at the time-averaged solvation shell. ",
-        "It is also possible using this program to generate the SDF based on some arbitrary ",
-        "Cartesian coordinate. To do that, simply omit the preliminary [gmx-trjconv] steps. \n",
-        "USAGE: \n",
-        "1. Use [gmx-make_ndx] to create a group containing the atoms around which you want the SDF \n",
-        "2. [TT]gmx trjconv -s a.tpr -f a.tng -o b.tng -boxcenter tric -ur compact -pbc none[tt] \n",
-        "3. [TT]gmx trjconv -s a.tpr -f b.tng -o c.tng -fit rot+trans[tt] \n",
-        "4. run [THISMODULE] on the [TT]c.tng[tt] output of step #3. \n",
-        "5. Load [TT]grid.cube[tt] into VMD and view as an isosurface. \n",
-        "[BB]Note[bb] that systems such as micelles will require [TT]gmx trjconv -pbc cluster[tt] between steps 1 and 2\n",
-        "WARNINGS:[BR]",
-        "The SDF will be generated for a cube that contains all bins that have some non-zero occupancy. ",
-        "However, the preparatory [TT]-fit rot+trans[tt] option to [gmx-trjconv] implies that your system will be rotating ",
-        "and translating in space (in order that the selected group does not). Therefore the values that are ",
-        "returned will only be valid for some region around your central group/coordinate that has full overlap ",
-        "with system volume throughout the entire translated/rotated system over the course of the trajectory. ",
-        "It is up to the user to ensure that this is the case. \n",
-        "BUGS:[BR]",
-        "When the allocated memory is not large enough, a segmentation fault may occur. This is usually detected ",
-        "and the program is halted prior to the fault while displaying a warning message suggesting the use of the [TT]-nab[tt] (Number of Additional Bins)",
-        "option. However, the program does not detect all such events. If you encounter a segmentation fault, run it again ",
-        "with an increased [TT]-nab[tt] value. \n",
-        "RISKY OPTIONS:[BR]",
-        "To reduce the amount of space and time required, you can output only the coords ",
-        "that are going to be used in the first and subsequent run through [gmx-trjconv]. ",
-        "However, be sure to set the [TT]-nab[tt] option to a sufficiently high value since ",
-        "memory is allocated for cube bins based on the initial coordinates and the [TT]-nab[tt] ",
-        "option value. \n"
+        "[THISMODULE] calculates the spatial distribution function and",
+        "outputs it in a form that can be read by VMD as Gaussian98 cube format.",
+        "For a system of 32,000 atoms and a 50 ns trajectory, the SDF can be generated",
+        "in about 30 minutes, with most of the time dedicated to the two runs through",
+        "[TT]trjconv[tt] that are required to center everything properly.",
+        "This also takes a whole bunch of space (3 copies of the trajectory file).",
+        "Still, the pictures are pretty and very informative when the fitted selection is properly made.",
+        "3-4 atoms in a widely mobile group (like a free amino acid in solution) works",
+        "well, or select the protein backbone in a stable folded structure to get the SDF",
+        "of solvent and look at the time-averaged solvation shell.",
+        "It is also possible using this program to generate the SDF based on some arbitrary",
+        "Cartesian coordinate. To do that, simply omit the preliminary [gmx-trjconv] steps.",
+        "",
+        "Usage:",
+        "",
+        "1. Use [gmx-make_ndx] to create a group containing the atoms around which you want the SDF",
+        "2. [TT]gmx trjconv -s a.tpr -f a.tng -o b.tng -boxcenter tric -ur compact -pbc none[tt]",
+        "3. [TT]gmx trjconv -s a.tpr -f b.tng -o c.tng -fit rot+trans[tt]",
+        "4. run [THISMODULE] on the [TT]c.tng[tt] output of step #3.",
+        "5. Load [TT]grid.cube[tt] into VMD and view as an isosurface.",
+        "",
+        "[BB]Note[bb] that systems such as micelles will require [TT]gmx trjconv -pbc cluster[tt] between steps 1 and 2.",
+        "",
+        "Warnings",
+        "^^^^^^^^",
+        "",
+        "The SDF will be generated for a cube that contains all bins that have some non-zero occupancy.",
+        "However, the preparatory [TT]-fit rot+trans[tt] option to [gmx-trjconv] implies that your system will be rotating",
+        "and translating in space (in order that the selected group does not). Therefore the values that are",
+        "returned will only be valid for some region around your central group/coordinate that has full overlap",
+        "with system volume throughout the entire translated/rotated system over the course of the trajectory.",
+        "It is up to the user to ensure that this is the case.",
+        "",
+        "Risky options",
+        "^^^^^^^^^^^^^",
+        "",
+        "To reduce the amount of space and time required, you can output only the coords",
+        "that are going to be used in the first and subsequent run through [gmx-trjconv].",
+        "However, be sure to set the [TT]-nab[tt] option to a sufficiently high value since",
+        "memory is allocated for cube bins based on the initial coordinates and the [TT]-nab[tt]",
+        "option value."
+    };
+    const char     *bugs[] = {
+        "When the allocated memory is not large enough, a segmentation fault may occur. This is usually detected "
+        "and the program is halted prior to the fault while displaying a warning message suggesting the use of the [TT]-nab[tt] (Number of Additional Bins) "
+        "option. However, the program does not detect all such events. If you encounter a segmentation fault, run it again "
+        "with an increased [TT]-nab[tt] value."
     };
 
     static gmx_bool bPBC         = FALSE;
@@ -155,7 +165,7 @@ int gmx_spatial(int argc, char *argv[])
     /* This is the routine responsible for adding default options,
      * calling the X/motif interface, etc. */
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
         return 0;
     }
index 784cbccae3520cc396765e31407685f33bf4dccc..ea86375c9c989a439faa1f7d3eba3ea64e21c3f4 100644 (file)
@@ -99,7 +99,7 @@ int gmx_trjorder(int argc, char *argv[])
         "In that case the reference group would be the protein and the group",
         "of molecules would consist of all the water atoms. When an index group",
         "of the first n waters is made, the ordered trajectory can be used",
-        "with any Gromacs program to analyze the n closest waters.",
+        "with any GROMACS program to analyze the n closest waters.",
         "[PAR]",
         "If the output file is a [REF].pdb[ref] file, the distance to the reference target",
         "will be stored in the B-factor field in order to color with e.g. Rasmol.",
index 4c1f7745b0f4b7c6db536d7ba789fc1c99dd785e..b293179c076f7ac79819bdeb8b1d4531dd6e2e4e 100644 (file)
@@ -2508,7 +2508,7 @@ int gmx_tune_pme(int argc, char *argv[])
     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", output_env_get_program_display_name(oenv),
+    fprintf(fp, "%s for GROMACS %s\n", output_env_get_program_display_name(oenv),
             gmx_version());
     if (!bThreads)
     {
index cdcd4bcac2c316fa125a3ca0ce2e6b50e423b68a..9e71686b393f3ebe718940a562df1fcdf617ee9a 100644 (file)
@@ -3222,36 +3222,36 @@ int gmx_wham(int argc, char *argv[])
         "",
         "At present, three input modes are supported.",
         "",
-        " * With option [TT]-it[tt], the user provides a file which contains the",
-        "   file names of the umbrella simulation run-input files ([REF].tpr[ref] files),",
-        "   AND, with option [TT]-ix[tt], a file which contains file names of",
-        "   the pullx [TT]mdrun[tt] output files. The [REF].tpr[ref] and pullx files must",
-        "   be in corresponding order, i.e. the first [REF].tpr[ref] created the",
-        "   first pullx, etc.",
-        " * Same as the previous input mode, except that the the user",
-        "   provides the pull force output file names ([TT]pullf.xvg[tt]) with option [TT]-if[tt].",
-        "   From the pull force the position in the umbrella potential is",
-        "   computed. This does not work with tabulated umbrella potentials.",
-        " * With option [TT]-ip[tt], the user provides file names of (gzipped) [REF].pdo[ref] files, i.e.",
-        "   the GROMACS 3.3 umbrella output files. If you have some unusual"
-        "   reaction coordinate you may also generate your own [REF].pdo[ref] files and",
-        "   feed them with the [TT]-ip[tt] option into to [THISMODULE]. The [REF].pdo[ref] file header",
-        "   must be similar to the following::",
+        "* With option [TT]-it[tt], the user provides a file which contains the",
+        "  file names of the umbrella simulation run-input files ([REF].tpr[ref] files),",
+        "  AND, with option [TT]-ix[tt], a file which contains file names of",
+        "  the pullx [TT]mdrun[tt] output files. The [REF].tpr[ref] and pullx files must",
+        "  be in corresponding order, i.e. the first [REF].tpr[ref] created the",
+        "  first pullx, etc.",
+        "* Same as the previous input mode, except that the the user",
+        "  provides the pull force output file names ([TT]pullf.xvg[tt]) with option [TT]-if[tt].",
+        "  From the pull force the position in the umbrella potential is",
+        "  computed. This does not work with tabulated umbrella potentials.",
+        "* With option [TT]-ip[tt], the user provides file names of (gzipped) [REF].pdo[ref] files, i.e.",
+        "  the GROMACS 3.3 umbrella output files. If you have some unusual"
+        "  reaction coordinate you may also generate your own [REF].pdo[ref] files and",
+        "  feed them with the [TT]-ip[tt] option into to [THISMODULE]. The [REF].pdo[ref] file header",
+        "  must be similar to the following::",
         "",
-        "     # UMBRELLA      3.0",
-        "     # Component selection: 0 0 1",
-        "     # nSkip 1",
-        "     # Ref. Group 'TestAtom'",
-        "     # Nr. of pull groups 2",
-        "     # Group 1 'GR1'  Umb. Pos. 5.0 Umb. Cons. 1000.0",
-        "     # Group 2 'GR2'  Umb. Pos. 2.0 Umb. Cons. 500.0",
-        "     #####",
+        "    # UMBRELLA      3.0",
+        "    # Component selection: 0 0 1",
+        "    # nSkip 1",
+        "    # Ref. Group 'TestAtom'",
+        "    # Nr. of pull groups 2",
+        "    # Group 1 'GR1'  Umb. Pos. 5.0 Umb. Cons. 1000.0",
+        "    # Group 2 'GR2'  Umb. Pos. 2.0 Umb. Cons. 500.0",
+        "    #####",
         "",
-        "   The number of pull groups, umbrella positions, force constants, and names ",
-        "   may (of course) differ. Following the header, a time column and ",
-        "   a data column for each pull group follows (i.e. the displacement",
-        "   with respect to the umbrella center). Up to four pull groups are possible ",
-        "   per [REF].pdo[ref] file at present.",
+        "  The number of pull groups, umbrella positions, force constants, and names ",
+        "  may (of course) differ. Following the header, a time column and ",
+        "  a data column for each pull group follows (i.e. the displacement",
+        "  with respect to the umbrella center). Up to four pull groups are possible ",
+        "  per [REF].pdo[ref] file at present.",
         "",
         "By default, all pull groups found in all pullx/pullf files are used in WHAM. If only ",
         "some of the pull groups should be used, a pull group selection file (option [TT]-is[tt]) can ",
@@ -3267,20 +3267,22 @@ int gmx_wham(int argc, char *argv[])
         "",
         "By default, the output files are",
         "",
-        " * [TT]-o[tt]      PMF output file",
-        " * [TT]-hist[tt]   Histograms output file",
+        "* [TT]-o[tt]      PMF output file",
+        "* [TT]-hist[tt]   Histograms output file",
         "",
         "Always check whether the histograms sufficiently overlap.[PAR]",
         "The umbrella potential is assumed to be harmonic and the force constants are ",
         "read from the [REF].tpr[ref] or [REF].pdo[ref] files. If a non-harmonic umbrella force was applied ",
-        "a tabulated potential can be provided with [TT]-tab[tt].[PAR]",
-        "WHAM OPTIONS[BR]------------[BR]",
+        "a tabulated potential can be provided with [TT]-tab[tt].",
         "",
-        " * [TT]-bins[tt]   Number of bins used in analysis",
-        " * [TT]-temp[tt]   Temperature in the simulations",
-        " * [TT]-tol[tt]    Stop iteration if profile (probability) changed less than tolerance",
-        " * [TT]-auto[tt]   Automatic determination of boundaries",
-        " * [TT]-min,-max[tt]   Boundaries of the profile",
+        "WHAM options",
+        "^^^^^^^^^^^^",
+        "",
+        "* [TT]-bins[tt]   Number of bins used in analysis",
+        "* [TT]-temp[tt]   Temperature in the simulations",
+        "* [TT]-tol[tt]    Stop iteration if profile (probability) changed less than tolerance",
+        "* [TT]-auto[tt]   Automatic determination of boundaries",
+        "* [TT]-min,-max[tt]   Boundaries of the profile",
         "",
         "The data points that are used to compute the profile",
         "can be restricted with options [TT]-b[tt], [TT]-e[tt], and [TT]-dt[tt]. ",
@@ -3297,10 +3299,16 @@ int gmx_wham(int argc, char *argv[])
         "periodicity of the system and generate a periodic PMF. The first and the last bin of the",
         "reaction coordinate will assumed be be neighbors.[PAR]",
         "Option [TT]-sym[tt] symmetrizes the profile around z=0 before output, ",
-        "which may be useful for, e.g. membranes.[PAR]",
-        "PARALLELIZATION[BR]----------------[BR]",
-        "If available, the number of OpenMP threads used by g_wham is controlled with [TT]-nt[tt].[PAR]",
-        "AUTOCORRELATIONS[BR]----------------[BR]",
+        "which may be useful for, e.g. membranes.",
+        "",
+        "Parallelization",
+        "^^^^^^^^^^^^^^^",
+        "",
+        "If available, the number of OpenMP threads used by g_wham is controlled with [TT]-nt[tt].",
+        "",
+        "Autocorrelations",
+        "^^^^^^^^^^^^^^^^",
+        "",
         "With [TT]-ac[tt], [THISMODULE] estimates the integrated autocorrelation ",
         "time (IACT) [GRK]tau[grk] for each umbrella window and weights the respective ",
         "window with 1/[1+2*[GRK]tau[grk]/dt]. The IACTs are written ",
@@ -3315,8 +3323,11 @@ int gmx_wham(int argc, char *argv[])
         "less robust) method such as fitting to a double exponential, you can ",
         "compute the IACTs with [gmx-analyze] and provide them to [THISMODULE] with the file ",
         "[TT]iact-in.dat[tt] (option [TT]-iiact[tt]), which should contain one line per ",
-        "input file ([REF].pdo[ref] or pullx/f file) and one column per pull group in the respective file.[PAR]",
-        "ERROR ANALYSIS[BR]--------------[BR]",
+        "input file ([REF].pdo[ref] or pullx/f file) and one column per pull group in the respective file.",
+        "",
+        "Error analysis",
+        "^^^^^^^^^^^^^^",
+        "",
         "Statistical errors may be estimated with bootstrap analysis. Use it with care, ",
         "otherwise the statistical error may be substantially underestimated. ",
         "More background and examples for the bootstrap technique can be found in ",
@@ -3325,36 +3336,36 @@ int gmx_wham(int argc, char *argv[])
         "Four bootstrapping methods are supported and ",
         "selected with [TT]-bs-method[tt].",
         "",
-        " * [TT]b-hist[tt]   Default: complete histograms are considered as independent ",
-        "   data points, and the bootstrap is carried out by assigning random weights to the ",
-        "   histograms (\"Bayesian bootstrap\"). Note that each point along the reaction coordinate",
-        "   must be covered by multiple independent histograms (e.g. 10 histograms), otherwise the ",
-        "   statistical error is underestimated.",
-        " * [TT]hist[tt]    Complete histograms are considered as independent data points. ",
-        "   For each bootstrap, N histograms are randomly chosen from the N given histograms ",
-        "   (allowing duplication, i.e. sampling with replacement).",
-        "   To avoid gaps without data along the reaction coordinate blocks of histograms ",
-        "   ([TT]-histbs-block[tt]) may be defined. In that case, the given histograms are ",
-        "   divided into blocks and only histograms within each block are mixed. Note that ",
-        "   the histograms within each block must be representative for all possible histograms, ",
-        "   otherwise the statistical error is underestimated.",
-        " * [TT]traj[tt]  The given histograms are used to generate new random trajectories,",
-        "   such that the generated data points are distributed according the given histograms ",
-        "   and properly autocorrelated. The autocorrelation time (ACT) for each window must be ",
-        "   known, so use [TT]-ac[tt] or provide the ACT with [TT]-iiact[tt]. If the ACT of all ",
-        "   windows are identical (and known), you can also provide them with [TT]-bs-tau[tt]. ",
-        "   Note that this method may severely underestimate the error in case of limited sampling, ",
-        "   that is if individual histograms do not represent the complete phase space at ",
-        "   the respective positions.",
-        " * [TT]traj-gauss[tt]  The same as method [TT]traj[tt], but the trajectories are ",
-        "   not bootstrapped from the umbrella histograms but from Gaussians with the average ",
-        "   and width of the umbrella histograms. That method yields similar error estimates ",
-        "   like method [TT]traj[tt].",
+        "* [TT]b-hist[tt]   Default: complete histograms are considered as independent ",
+        "  data points, and the bootstrap is carried out by assigning random weights to the ",
+        "  histograms (\"Bayesian bootstrap\"). Note that each point along the reaction coordinate",
+        "  must be covered by multiple independent histograms (e.g. 10 histograms), otherwise the ",
+        "  statistical error is underestimated.",
+        "* [TT]hist[tt]    Complete histograms are considered as independent data points. ",
+        "  For each bootstrap, N histograms are randomly chosen from the N given histograms ",
+        "  (allowing duplication, i.e. sampling with replacement).",
+        "  To avoid gaps without data along the reaction coordinate blocks of histograms ",
+        "  ([TT]-histbs-block[tt]) may be defined. In that case, the given histograms are ",
+        "  divided into blocks and only histograms within each block are mixed. Note that ",
+        "  the histograms within each block must be representative for all possible histograms, ",
+        "  otherwise the statistical error is underestimated.",
+        "* [TT]traj[tt]  The given histograms are used to generate new random trajectories,",
+        "  such that the generated data points are distributed according the given histograms ",
+        "  and properly autocorrelated. The autocorrelation time (ACT) for each window must be ",
+        "  known, so use [TT]-ac[tt] or provide the ACT with [TT]-iiact[tt]. If the ACT of all ",
+        "  windows are identical (and known), you can also provide them with [TT]-bs-tau[tt]. ",
+        "  Note that this method may severely underestimate the error in case of limited sampling, ",
+        "  that is if individual histograms do not represent the complete phase space at ",
+        "  the respective positions.",
+        "* [TT]traj-gauss[tt]  The same as method [TT]traj[tt], but the trajectories are ",
+        "  not bootstrapped from the umbrella histograms but from Gaussians with the average ",
+        "  and width of the umbrella histograms. That method yields similar error estimates ",
+        "  like method [TT]traj[tt].",
         "",
         "Bootstrapping output:",
         "",
-        " * [TT]-bsres[tt]   Average profile and standard deviations",
-        " * [TT]-bsprof[tt]  All bootstrapping profiles",
+        "* [TT]-bsres[tt]   Average profile and standard deviations",
+        "* [TT]-bsprof[tt]  All bootstrapping profiles",
         "",
         "With [TT]-vbs[tt] (verbose bootstrapping), the histograms of each bootstrap are written, ",
         "and, with bootstrap method [TT]traj[tt], the cumulative distribution functions of ",
index ec964b3bd9f1966ae60530d60fd909b0bee8116c..dfe59a730939bc1958d6b40ac56cd453cd8038db 100644 (file)
@@ -1791,8 +1791,8 @@ static void check_match(FILE *fplog,
     if (mm)
     {
         const char msg_version_difference[] =
-            "The current Gromacs major & minor version are not identical to those that\n"
-            "generated the checkpoint file. In principle Gromacs does not support\n"
+            "The current GROMACS major & minor version are not identical to those that\n"
+            "generated the checkpoint file. In principle GROMACS does not support\n"
             "continuation from checkpoints between different versions, so we advise\n"
             "against this. If you still want to try your luck we recommend that you use\n"
             "the -noappend flag to keep your output files from the two versions separate.\n"
@@ -1800,7 +1800,7 @@ static void check_match(FILE *fplog,
             "file have changed between the different major & minor versions.\n";
 
         const char msg_mismatch_notice[] =
-            "Gromacs patchlevel, binary or parallel settings differ from previous run.\n"
+            "GROMACS patchlevel, binary or parallel settings differ from previous run.\n"
             "Continuation is exact, but not guaranteed to be binary identical.\n";
 
         const char msg_logdetails[] =
index 2748e810dce30b0ce046ee7460ad4e1a897934a8..b5ffff65fda4f32327f0fb1f3d33626741e9321d 100644 (file)
@@ -650,7 +650,7 @@ extern void gmx_print_version_info_cuda_gpu(FILE *fp);
 
 static void gmx_print_version_info(FILE *fp)
 {
-    fprintf(fp, "Gromacs version:    %s\n", gmx_version());
+    fprintf(fp, "GROMACS version:    %s\n", gmx_version());
     const char *const git_hash = gmx_version_git_full_hash();
     if (git_hash[0] != '\0')
     {
index 44091a79e292e98818f25de455f0cfb5dd20f22c..9791608f4b61e5059e7297712fa0c20bb46b864a 100644 (file)
@@ -1348,7 +1348,7 @@ gmx_cpuid_simd_check(gmx_cpuid_t   cpuid,
         }
         if (print_to_stderr)
         {
-            fprintf(stderr, "Compiled SIMD instructions: %s (Gromacs could use %s on this machine, which is better)\n",
+            fprintf(stderr, "Compiled SIMD instructions: %s (GROMACS could use %s on this machine, which is better)\n",
                     gmx_cpuid_simd_string[compiled_simd],
                     gmx_cpuid_simd_string[simd]);
         }
index 345822e4127be4639c7182f9d1086de23fc880cf..30881cbf299ca5a8ce58338b5a48a69978c0975a 100644 (file)
@@ -1710,7 +1710,7 @@ int gmx_grompp(int argc, char *argv[])
                       "\n"
                       "It appears as if you are trying to run a QM/MM calculation, but the force\n"
                       "field you are using does not contain atom numbers fields. This is an\n"
-                      "optional field (introduced in Gromacs 3.3) for general runs, but mandatory\n"
+                      "optional field (introduced in GROMACS 3.3) for general runs, but mandatory\n"
                       "for QM/MM. The good news is that it is easy to add - put the atom number as\n"
                       "an integer just before the mass column in ffXXXnb.itp.\n"
                       "NB: United atoms have the same atom numbers as normal ones.\n\n");
index dfae1420ef96e2b3e4c74e95a68c5fc2011ae7ca..920c3a38f9db69948ce9a2ff4d7dc53ef8800c4a 100644 (file)
@@ -562,7 +562,7 @@ void print_top_comment(FILE       *out,
 
     if (strchr(ffdir, '/') == NULL)
     {
-        fprintf(out, ";\tForce field was read from the standard Gromacs share directory.\n;\n\n");
+        fprintf(out, ";\tForce field was read from the standard GROMACS share directory.\n;\n\n");
     }
     else if (ffdir[0] == '.')
     {
index 8829e77d6f61afd64e41cd343a2756fd9092787a..9e39ad6edea032c6d4e8b4e87b9f97a6fb602bbc 100644 (file)
@@ -278,7 +278,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
     if (ir->cutoff_scheme == ecutsGROUP)
     {
         warning_note(wi,
-                     "The group cutoff scheme is deprecated in Gromacs 5.0 and will be removed in a future "
+                     "The group cutoff scheme is deprecated since GROMACS 5.0 and will be removed in a future "
                      "release when all interaction forms are supported for the verlet scheme. The verlet "
                      "scheme already scales better, and it is compatible with GPUs and other accelerators.");
 
@@ -657,7 +657,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         sprintf(err_buf, "Can't use postive delta-lambda (%g) with expanded ensemble simulations", fep->delta_lambda);
         CHECK(fep->delta_lambda > 0 && (ir->efep == efepEXPANDED));
 
-        sprintf(err_buf, "Can only use expanded ensemble with md-vv for now; should be supported for other integrators in 5.0");
+        sprintf(err_buf, "Can only use expanded ensemble with md-vv (for now)");
         CHECK(!(EI_VV(ir->eI)) && (ir->efep == efepEXPANDED));
 
         sprintf(err_buf, "Free-energy not implemented for Ewald");
index eaa00e1638f0c107a8cad6f2b81c07a05757a454..4c581cb9f5a3076cd2ff4b38a2ecdc058a6f2885 100644 (file)
@@ -1,6 +1,6 @@
 These files are semi-automatic translations by f2c from the original netlib BLAS library.
 The source has been modified to (mostly) use modern C formatting, and to get rid of
-compiler warnings. Any errors in doing this should be blamed on the Gromacs developers, and
+compiler warnings. Any errors in doing this should be blamed on the GROMACS developers, and
 not the reference BLAS implementation.
 
 The reference BLAS implementation is available from http://www.netlib.org/blas 
@@ -11,10 +11,10 @@ BLAS does not come with a formal named "license", but a general statement that
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
+While the rest of GROMACS is LGPL, we think it's only fair to give you the same rights to
 our modified BLAS files as the original netlib versions, so do what you want with them.
 However, be warned that we have only tested that they to the right thing in the cases used
-in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
+in GROMACS (primarily full & sparse matrix diagonalization), so in most cases it is a much
 better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
index c4cc48cecf4eb0e9d6e460f6b05ac1021bbb701d..6364e8447ec37171643ac9b29e457a484cf85461 100644 (file)
@@ -1,6 +1,6 @@
 These files are semi-automatic translations by f2c from the original netlib LAPACK library.
 The source has been modified to (mostly) use modern C formatting, and to get rid of
-compiler warnings. Any errors in doing this should be blamed on the Gromacs developers, and
+compiler warnings. Any errors in doing this should be blamed on the GROMACS developers, and
 not the reference LAPACK implementation.
 
 The reference LAPACK implementation is available from http://www.netlib.org/lapack 
@@ -11,11 +11,11 @@ LAPACK does not come with a formal named "license", but a general statement sayi
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
+While the rest of GROMACS is LGPL, we think it's only fair to give you the same rights to
 our modified LAPACK files as the original netlib versions, so do what you want with them.
 
 However, be warned that we have only tested that they to the right thing in the cases used
-in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
+in GROMACS (primarily full & sparse matrix diagonalization), so in most cases it is a much
 better idea to use the full reference implementation.
 
 Erik Lindahl, 2008-10-07.
index f95db0b9c515605199007ac2d7aeb076e32d0853..3f68624adddcea65c36c0ae5bb72e319f9182611 100644 (file)
@@ -262,7 +262,7 @@ calc_one_bond(int thread,
 #ifdef GMX_SIMD_HAVE_REAL
     gmx_bool bUseSIMD;
     /* MSVC 2010 produces buggy SIMD PBC code, disable SIMD for MSVC <= 2010 */
-#if defined _MSC_VER && _MSC_VER < 1700
+#if defined _MSC_VER && _MSC_VER < 1700 && !defined(__ICL)
     bUseSIMD = FALSE;
 #else
     bUseSIMD = fr->use_simd_kernels;
index 7be3cef649211d2536bdfd3e541ced058f170be9..11bdfd81b59414327b904be007c87a125cbfa80c 100644 (file)
@@ -68,7 +68,7 @@
 #include "gromacs/utility/smalloc.h"
 
 /* MSVC 2010 produces buggy SIMD PBC code, disable SIMD for MSVC <= 2010 */
-#if defined GMX_SIMD_HAVE_REAL && !(defined _MSC_VER && _MSC_VER < 1700)
+#if defined GMX_SIMD_HAVE_REAL && !(defined _MSC_VER && _MSC_VER < 1700) && !defined(__ICL)
 #define LINCS_SIMD
 #endif
 
index 3324370c237520f693319ba13e1aa7b6accaf4d9..e5becd42053c11141216b368d0dd479f524cf4ff 100644 (file)
@@ -1609,7 +1609,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 #ifdef GMX_NBNXN_SIMD_4XN
             *kernel_type = nbnxnk4xN_SIMD_4xN;
 #else
-            gmx_fatal(FARGS, "SIMD 4xN kernels requested, but Gromacs has been compiled without support for these kernels");
+            gmx_fatal(FARGS, "SIMD 4xN kernels requested, but GROMACS has been compiled without support for these kernels");
 #endif
         }
         if (getenv("GMX_NBNXN_SIMD_2XNN") != NULL)
@@ -1617,7 +1617,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 #ifdef GMX_NBNXN_SIMD_2XNN
             *kernel_type = nbnxnk4xN_SIMD_2xNN;
 #else
-            gmx_fatal(FARGS, "SIMD 2x(N+N) kernels requested, but Gromacs has been compiled without support for these kernels");
+            gmx_fatal(FARGS, "SIMD 2x(N+N) kernels requested, but GROMACS has been compiled without support for these kernels");
 #endif
         }
 
index b9796239ab1b539ac179b447461cfb23be0a7e4c..b29a8dc7e2e715f2793341fc9fb0007452c1d3f6 100644 (file)
@@ -2678,9 +2678,9 @@ double do_nm(FILE *fplog, t_commrec *cr,
     if (bIsMaster)
     {
         fprintf(stderr,
-                "NOTE: This version of Gromacs has been compiled in single precision,\n"
+                "NOTE: This version of GROMACS has been compiled in single precision,\n"
                 "      which MIGHT not be accurate enough for normal mode analysis.\n"
-                "      Gromacs now uses sparse matrix storage, so the memory requirements\n"
+                "      GROMACS now uses sparse matrix storage, so the memory requirements\n"
                 "      are fairly modest even if you recompile in double precision.\n\n");
     }
 #endif
index b78b3c2b915ae5c581d88d20496607df73d83b72..d6e9314fb16a70eeca45b33d9fb3774d8463a34c 100644 (file)
@@ -3,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.
@@ -211,7 +211,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     if (maxsr < 0)
     {
         gmx_fatal(FARGS, "%s, %d: Negative number of short range atoms.\n"
-                  "Call your Gromacs dealer for assistance.", __FILE__, __LINE__);
+                  "Call your GROMACS dealer for assistance.", __FILE__, __LINE__);
     }
     /* This is just for initial allocation, so we do not reallocate
      * all the nlist arrays many times in a row.
index da745706f6bcfdd4bfb308ef447e41b5e1e159b4..744efd51af0e059380d0ab0a151029c74749ed85 100644 (file)
@@ -70,7 +70,6 @@
 #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"
@@ -464,11 +463,6 @@ double do_tpi(FILE *fplog, t_commrec *cr,
             gmx_fatal(FARGS, "Unknown integrator %s", ei_names[inputrec->eI]);
     }
 
-#ifdef GMX_SIMD
-    /* Make sure we don't detect SIMD overflow generated before this point */
-    gmx_simd_check_and_reset_overflow();
-#endif
-
     while (bNotLastFrame)
     {
         frame_step      = rerun_fr.step;
@@ -668,17 +662,7 @@ double do_tpi(FILE *fplog, t_commrec *cr,
 
             epot               = enerd->term[F_EPOT];
             bEnergyOutOfBounds = FALSE;
-#ifdef GMX_SIMD_X86_SSE2_OR_HIGHER
-            /* With SSE the energy can overflow, check for this */
-            if (gmx_simd_check_and_reset_overflow())
-            {
-                if (debug)
-                {
-                    fprintf(debug, "Found an SSE overflow, assuming the energy is out of bounds\n");
-                }
-                bEnergyOutOfBounds = TRUE;
-            }
-#endif
+
             /* If the compiler doesn't optimize this check away
              * we catch the NAN energies.
              * The epot>GMX_REAL_MAX check catches inf values,
diff --git a/src/gromacs/onlinehelp-doc.h b/src/gromacs/onlinehelp-doc.h
new file mode 100644 (file)
index 0000000..fd1e7a0
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * 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 \defgroup module_onlinehelp Help Formatting for Online Help (onlinehelp)
+ * \ingroup group_utilitymodules
+ * \brief
+ * Provides functionality for formatting help text for console and reStructuredText.
+ *
+ * This module provides helper functions and classes for formatting text to the
+ * console and as reStructuredText through a single interface.  The main
+ * components of the module are:
+ *  - gmx::HelpWriterContext provides a single interface that can produce both
+ *    output formats from the same input strings and API calls.  Whenever
+ *    possible, the output format should be abstracted using this interface,
+ *    but in some cases code still writes out raw reStructuredText.
+ *  - rstparser.h provides the functionality to parse reStructuredText such that
+ *    it can be rewrapped for console output.
+ *  - helpformat.h provides some general text-processing classes, currently
+ *    focused on producing aligned tables for console output.
+ *  - helptopicinterface.h, helptopic.h, and helpmanager.h provide classes for
+ *    managing a hierarchy of help topics and printing out help from this
+ *    hierarchy.
+ *
+ * The formatting syntax for strings accepted by this module is described in
+ * \ref page_onlinehelp.  The module is currently exposed outside \Gromacs only
+ * through this formatting syntax, not any API calls.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ */
+/*! \internal \file
+ * \brief
+ * Dummy header for \ref module_onlinehelp documentation.
+ */
index 2a6479ed273adfc8b2664fa89ea0a005f098a77e..79dfbc390be04a666908103e9e3c6cb07079a2a0 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) 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.
  * 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_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.
index 415f2602f7f9d57d4cae5d5233d6a3fc058b38f0..0c3c37abf373baedc9d9b6a656610c08f913a4cc 100644 (file)
@@ -57,6 +57,8 @@
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/stringutil.h"
 
+#include "rstparser.h"
+
 namespace gmx
 {
 
@@ -131,7 +133,6 @@ const t_sandr sandrTty[] = {
     { "[TANH]", "tanh(" },
     { "[tanh]", ")" },
     { "[PAR]", "\n\n" },
-    { "[BR]", "\n"},
     { "[GRK]", "" },
     { "[grk]", "" }
 };
@@ -181,8 +182,6 @@ const t_sandr sandrRst[] = {
     { "[TANH]", "tanh(" },
     { "[tanh]", ")" },
     { "[PAR]", "\n\n" },
-    // [BR] is fundamentally incompatible with rst
-    { "[BR]", "\n\n"},
     { "[GRK]", "" },
     { "[grk]", "" }
 };
@@ -341,36 +340,6 @@ std::string removeExtraNewlinesRst(const std::string &text)
     return result;
 }
 
-/*! \brief
- * Returns `true` if a list item starts in \p text at \p index.
- *
- * Does not throw.
- */
-bool startsListItem(const std::string &text, size_t index)
-{
-    if (text.length() <= index + 1)
-    {
-        return false;
-    }
-    if (text[index] == '*' && std::isspace(text[index+1]))
-    {
-        return true;
-    }
-    if (std::isdigit(text[index]))
-    {
-        while (index < text.length() && std::isdigit(text[index]))
-        {
-            ++index;
-        }
-        if (text.length() > index + 1 && text[index] == '.'
-            && std::isspace(text[index+1]))
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
 //! \}
 
 }   // namespace
@@ -577,126 +546,18 @@ void HelpWriterContext::Impl::processMarkup(const std::string &text,
             const int   baseIndent          = wrapper->settings().indent();
             result = repall(result, sandrTty);
             result = replaceLinks(result);
-            std::string paragraph;
+            std::string          paragraph;
             paragraph.reserve(result.length());
-            size_t      i             = 0;
-            int         nextBreakSize = 0;
-            bool        bLiteral      = false;
-            while (i < result.length())
+            RstParagraphIterator iter(result);
+            while (iter.nextParagraph())
             {
-                while (i < result.length() && result[i] == '\n')
-                {
-                    ++i;
-                }
-                if (i == result.length())
-                {
-                    break;
-                }
-                const int breakSize     = nextBreakSize;
-                int       currentLine   = 0;
-                bool      bLineStart    = true;
-                int       currentIndent = 0;
-                int       firstIndent   = 0;
-                int       indent        = 0;
-                paragraph.clear();
-                for (;; ++i)
-                {
-                    if (result[i] == '\n' || i == result.length())
-                    {
-                        if (currentLine == 0)
-                        {
-                            firstIndent = currentIndent;
-                        }
-                        else if (currentLine == 1)
-                        {
-                            indent = currentIndent;
-                        }
-                        ++currentLine;
-                        bLineStart    = true;
-                        currentIndent = 0;
-                        if (i + 1 >= result.length() || result[i + 1] == '\n')
-                        {
-                            nextBreakSize = 2;
-                            break;
-                        }
-                        if (!bLiteral)
-                        {
-                            if (!std::isspace(result[i - 1]))
-                            {
-                                paragraph.push_back(' ');
-                            }
-                            continue;
-                        }
-                    }
-                    else if (bLineStart)
-                    {
-                        if (std::isspace(result[i]))
-                        {
-                            ++currentIndent;
-                            continue;
-                        }
-                        else if (startsListItem(result, i))
-                        {
-                            if (currentLine > 0)
-                            {
-                                while (i > 0 && result[i - 1] != '\n')
-                                {
-                                    --i;
-                                }
-                                paragraph     = stripString(paragraph);
-                                nextBreakSize = 1;
-                                break;
-                            }
-                            int prefixLength = 0;
-                            while (!std::isspace(result[i + prefixLength]))
-                            {
-                                ++prefixLength;
-                            }
-                            while (i + prefixLength < result.length()
-                                   && std::isspace(result[i + prefixLength]))
-                            {
-                                ++prefixLength;
-                            }
-                            indent = currentIndent + prefixLength;
-                        }
-                        bLineStart = false;
-                    }
-                    paragraph.push_back(result[i]);
-                }
-                if (endsWith(paragraph, "::"))
-                {
-                    bLiteral = true;
-                    if (paragraph.length() == 2)
-                    {
-                        if (breakSize == 0)
-                        {
-                            nextBreakSize = 0;
-                        }
-                        continue;
-                    }
-                    if (paragraph[paragraph.length() - 3] == ' ')
-                    {
-                        paragraph.resize(paragraph.length() - 3);
-                    }
-                    else
-                    {
-                        paragraph.resize(paragraph.length() - 1);
-                    }
-                }
-                else
-                {
-                    bLiteral = false;
-                }
-                if (breakSize > 0)
-                {
-                    wrapper->wrap(std::string(breakSize, '\n'));
-                }
-                wrapper->settings().setFirstLineIndent(baseFirstLineIndent + firstIndent);
-                wrapper->settings().setIndent(baseIndent + indent);
+                iter.getParagraphText(&paragraph);
+                wrapper->settings().setFirstLineIndent(baseFirstLineIndent + iter.firstLineIndent());
+                wrapper->settings().setIndent(baseIndent + iter.indent());
                 wrapper->wrap(paragraph);
-                wrapper->settings().setFirstLineIndent(baseFirstLineIndent);
-                wrapper->settings().setIndent(baseIndent);
             }
+            wrapper->settings().setFirstLineIndent(baseFirstLineIndent);
+            wrapper->settings().setIndent(baseIndent);
             break;
         }
         case eHelpOutputFormat_Rst:
diff --git a/src/gromacs/onlinehelp/rstparser.cpp b/src/gromacs/onlinehelp/rstparser.cpp
new file mode 100644 (file)
index 0000000..dc5edac
--- /dev/null
@@ -0,0 +1,340 @@
+/*
+ * 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.
+ */
+/*! \internal \file
+ * \brief
+ * Implements classes from rstparser.h.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_onlinehelp
+ */
+#include "gmxpre.h"
+
+#include "rstparser.h"
+
+#include <cctype>
+
+#include <algorithm>
+
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+namespace
+{
+
+/*! \brief
+ * Counts the number of leading spaces in a text range.
+ *
+ * Does not throw.
+ */
+int countLeadingSpace(const std::string &text, size_t start, size_t end)
+{
+    for (size_t i = start; i < end; ++i)
+    {
+        if (!std::isspace(text[i]))
+        {
+            return i - start;
+        }
+    }
+    return end - start;
+}
+
+/*! \brief
+ * Returns `true` if a list item starts in \p text at \p index.
+ *
+ * Does not throw.
+ */
+bool startsListItem(const std::string &text, size_t index)
+{
+    if (text.length() <= index + 1)
+    {
+        return false;
+    }
+    if (text[index] == '*' && std::isspace(text[index+1]))
+    {
+        return true;
+    }
+    if (std::isdigit(text[index]))
+    {
+        while (index < text.length() && std::isdigit(text[index]))
+        {
+            ++index;
+        }
+        if (text.length() > index + 1 && text[index] == '.'
+            && std::isspace(text[index+1]))
+        {
+            return true;
+        }
+    }
+    return false;
+}
+
+/*! \brief
+ * Returns `true` if a table starts in \p text at \p index.
+ *
+ * The function only inspects the first line for something that looks like a
+ * reStructuredText table, and accepts also some malformed tables.
+ * Any issues should be apparent when Sphinx parses the reStructuredText
+ * export, so full validation is not done here.
+ *
+ * Does not throw.
+ */
+bool startsTable(const std::string &text, size_t index)
+{
+    if (text[index] == '=')
+    {
+        while (index < text.length() && text[index] != '\n')
+        {
+            if (text[index] != '=' && !std::isspace(text[index]))
+            {
+                return false;
+            }
+            ++index;
+        }
+        return true;
+    }
+    else if (text[index] == '+')
+    {
+        while (index < text.length() && text[index] != '\n')
+        {
+            if (text[index] != '-' && text[index] != '+')
+            {
+                return false;
+            }
+            ++index;
+        }
+        return true;
+    }
+    return false;
+}
+
+/*! \brief
+ * Returns `true` if a line in \p text starting at \p index is a title underline.
+ *
+ * Does not throw.
+ */
+bool isTitleUnderline(const std::string &text, size_t index)
+{
+    const char firstChar = text[index];
+    if (std::ispunct(firstChar))
+    {
+        while (index < text.length() && text[index] != '\n')
+        {
+            if (text[index] != firstChar)
+            {
+                return false;
+            }
+            ++index;
+        }
+        return true;
+    }
+    return false;
+}
+
+}    // namespace
+
+/********************************************************************
+ * RstParagraphIterator
+ */
+
+RstParagraphIterator::RstParagraphIterator(const std::string &text)
+    : text_(text), begin_(0), end_(0), type_(eParagraphType_Normal),
+      breakSize_(0), firstLineIndent_(0), indent_(0),
+      nextBegin_(0), nextBreakSize_(0), literalIndent_(-1)
+{
+}
+
+bool RstParagraphIterator::nextParagraph()
+{
+    begin_     = nextBegin_;
+    type_      = eParagraphType_Normal;
+    breakSize_ = nextBreakSize_;
+    // Skip leading newlines (includes those separating paragraphs).
+    while (begin_ < text_.length() && text_[begin_] == '\n')
+    {
+        ++begin_;
+    }
+    if (begin_ == text_.length())
+    {
+        end_       = begin_;
+        breakSize_ = 0;
+        nextBegin_ = begin_;
+        return false;
+    }
+    if (literalIndent_ >= 0)
+    {
+        type_ = eParagraphType_Literal;
+    }
+    // Loop over lines in input until the end of the current paragraph.
+    size_t i         = begin_;
+    int    lineCount = 0;
+    while (true)
+    {
+        const bool   bFirstLine = (lineCount == 0);
+        const size_t lineStart  = i;
+        const size_t lineEnd    = std::min(text_.find('\n', i), text_.length());
+        const int    lineIndent = countLeadingSpace(text_, lineStart, lineEnd);
+        const size_t textStart  = lineStart + lineIndent;
+        const bool   bListItem  = startsListItem(text_, textStart);
+        // Return each list item as a separate paragraph to make the behavior
+        // the same always; the item text could even contain multiple
+        // paragraphs, that would anyways produce breaks.
+        if (bListItem && !bFirstLine)
+        {
+            // Since there was no empty line in input, do not produce one in
+            // the output, either.
+            nextBreakSize_ = 1;
+            // end_ is not updated to break the paragraph before the current line.
+            break;
+        }
+        // Now we will actually use this line as part of this paragraph.
+        end_ = lineEnd;
+        ++lineCount;
+        // Update indentation.
+        if (bFirstLine)
+        {
+            firstLineIndent_ = indent_ = lineIndent;
+            if (bListItem)
+            {
+                // Find the indentation of the actual text after the
+                // bullet/number.
+                int prefixLength = 0;
+                while (!std::isspace(text_[textStart + prefixLength]))
+                {
+                    ++prefixLength;
+                }
+                while (textStart + prefixLength < text_.length()
+                       && std::isspace(text_[textStart + prefixLength]))
+                {
+                    ++prefixLength;
+                }
+                indent_ += prefixLength;
+            }
+        }
+        else
+        {
+            indent_ = std::min(indent_, lineIndent);
+        }
+        // We need to check for the title underline before checking for the
+        // paragraph break so that the title is correctly recognized.
+        if (lineCount == 2 && isTitleUnderline(text_, lineStart))
+        {
+            type_ = eParagraphType_Title;
+        }
+        // Check for end-of-input or an empty line, i.e., a normal paragraph
+        // break.
+        if (lineEnd + 1 >= text_.length() || text_[lineEnd + 1] == '\n')
+        {
+            nextBreakSize_ = 2;
+            break;
+        }
+        // Always return the title as a separate paragraph, as it requires
+        // different processing.
+        // TODO: This should allow nicer formatting that shares
+        // implementation with writeTitle() and honors the nesting depths etc.,
+        // but that is not implemented.
+        if (type_ == eParagraphType_Title)
+        {
+            // If we are here, there was no actual paragraph break, so do not
+            // produce one in the output either.
+            nextBreakSize_ = 1;
+            break;
+        }
+        // Next loop starts at the character after the newline.
+        i = lineEnd + 1;
+    }
+    nextBegin_ = end_;
+    // Check if the next paragraph should be treated as a literal paragraph,
+    // and deal with transformations for the :: marker.
+    if (end_ - begin_ >= 2 && text_.compare(end_ - 2, 2, "::") == 0)
+    {
+        literalIndent_ = indent_;
+        // Return the actual literal block if the paragraph was just an "::".
+        if (end_ - begin_ == 2)
+        {
+            // Avoid leading whitespace at the beginning; breakSize_ == 0
+            // only for the first paragraph.
+            if (breakSize_ == 0)
+            {
+                nextBreakSize_ = 0;
+            }
+            return nextParagraph();
+        }
+        // Remove one of the colons, or both if preceded by whitespace.
+        const bool bRemoveDoubleColon = (text_[end_ - 3] == ' ');
+        end_ -= (bRemoveDoubleColon ? 3 : 1);
+    }
+    else
+    {
+        literalIndent_ = -1;
+    }
+    // Treat a table like a literal block (preserve newlines).
+    if (startsTable(text_, begin_ + firstLineIndent_))
+    {
+        type_ = eParagraphType_Literal;
+    }
+    return true;
+}
+
+void RstParagraphIterator::getParagraphText(std::string *result) const
+{
+    result->clear();
+    result->reserve(end_ - begin_);
+    result->append(breakSize_, '\n');
+    const bool bPreserveNewlines = (type_ != eParagraphType_Normal);
+    size_t     i                 = begin_;
+    while (i < end_)
+    {
+        const bool   bFirstLine = (i == begin_);
+        const size_t lineStart  = i + (bFirstLine ? firstLineIndent_ : indent_);
+        const size_t lineEnd    = std::min(text_.find('\n', i), end_);
+        if (!bFirstLine)
+        {
+            if (bPreserveNewlines)
+            {
+                result->push_back('\n');
+            }
+            else if (!std::isspace((*result)[result->length() - 1]))
+            {
+                result->push_back(' ');
+            }
+        }
+        result->append(text_, lineStart, lineEnd - lineStart);
+        i = lineEnd + 1;
+    }
+}
+
+} // namespace gmx
diff --git a/src/gromacs/onlinehelp/rstparser.h b/src/gromacs/onlinehelp/rstparser.h
new file mode 100644 (file)
index 0000000..c250209
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares classes for (partial) parsing of reStructuredText.
+ *
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \ingroup module_onlinehelp
+ */
+#ifndef GMX_ONLINEHELP_RSTPARSER_H
+#define GMX_ONLINEHELP_RSTPARSER_H
+
+#include <string>
+
+#include "gromacs/utility/classhelpers.h"
+
+namespace gmx
+{
+
+class TextLineWrapperSettings;
+
+/*! \internal
+ * \brief
+ * Iterator over reStructuredText paragraphs.
+ *
+ * After initialization, nextParagraph() needs to be called to access the first
+ * paragraph.  Subsequence paragraphs can be accessed by repeated calls to
+ * nextParagraph().  After the last paragraph, nextParagraph() returns `false`.
+ *
+ * After each call to nextParagraph(), other methods can be called to query
+ * details of the current paragraph.
+ *
+ * \ingroup module_onlinehelp
+ */
+class RstParagraphIterator
+{
+    public:
+        /*! \brief
+         * Initializes an iterator for given input text.
+         *
+         * Does not throw.
+         */
+        explicit RstParagraphIterator(const std::string &text);
+
+        /*! \brief
+         * Advances the iterator to the next paragraph.
+         *
+         * \returns `false` if there were no more paragraphs.
+         *
+         * Does not throw (except std::bad_alloc if std::string::compare()
+         * throws).
+         */
+        bool nextParagraph();
+
+        //! Returns the indentation for first line of this paragraph.
+        int firstLineIndent() const { return firstLineIndent_; }
+        //! Returns the indentation for subsequent lines of this paragraph.
+        int indent() const { return indent_; }
+        /*! \brief
+         * Returns the text
+         *
+         * \param[out] result  Variable to receive the paragraph text.
+         * \throws std::bad_alloc if out of memory.
+         *
+         * Indentation and internal line breaks have been stripped from the
+         * paragraph text (except for literal blocks etc.).  For literal
+         * blocks, the common indentation has been stripped and is returned in
+         * indent() instead.
+         *
+         * Leading newlines are returned to indicate necessary separation from
+         * the preceding paragraph.
+         */
+        void getParagraphText(std::string *result) const;
+
+    private:
+        enum ParagraphType
+        {
+            eParagraphType_Normal,
+            eParagraphType_Literal,
+            eParagraphType_Title
+        };
+
+        //! The text to iterate over.
+        const std::string &text_;
+
+        //! Start of the current paragraph.
+        size_t             begin_;
+        //! End of the current paragraph (C++-style iterator).
+        size_t             end_;
+        //! Type of the current paragraph.
+        ParagraphType      type_;
+        //! Number of newlines to print before the current paragraph.
+        int                breakSize_;
+        //! Indentation of the first line of this paragraph.
+        int                firstLineIndent_;
+        //! (Minimum) indentation of other lines in this paragraph.
+        int                indent_;
+
+        //! Start of the next paragrah.
+        size_t             nextBegin_;
+        //! Number of newlines to print after the current paragraph.
+        int                nextBreakSize_;
+        /*! \brief
+         * Indentation of the preceding paragraph that contained `::`.
+         *
+         * If the next paragraph is not a literal block, the value is `-1`.
+         */
+        int                literalIndent_;
+
+        GMX_DISALLOW_COPY_AND_ASSIGN(RstParagraphIterator);
+};
+
+} // namespace gmx
+
+#endif
index 9db5f0e3403159f08174d5320e5b40a99ef86637..d41ca87f6b2a9317e3682e81a53970b71ae7aa82 100644 (file)
@@ -168,6 +168,20 @@ TEST_F(HelpWriterContextTest, FormatsLiteralTextAtBeginning)
     testFormatting(text);
 }
 
+TEST_F(HelpWriterContextTest, FormatsLiteralTextWithIndentation)
+{
+    const char *const text[] = {
+        "Sample paragraph::",
+        "",
+        "    literal block",
+        "      another indented line",
+        "",
+        "Normal paragraph",
+        "with wrapping"
+    };
+    testFormatting(text);
+}
+
 TEST_F(HelpWriterContextTest, FormatsBulletList)
 {
     const char *const text[] = {
@@ -207,4 +221,53 @@ TEST_F(HelpWriterContextTest, FormatsEnumeratedList)
     testFormatting(text);
 }
 
+TEST_F(HelpWriterContextTest, FormatsSimpleTable)
+{
+    const char *const text[] = {
+        "Simple table:",
+        "",
+        "============  =============",
+        "First column  Second header",
+        "============  =============",
+        "text          text",
+        "============  =============",
+        "",
+        "Normal paragraph",
+        "again."
+    };
+    testFormatting(text);
+}
+
+TEST_F(HelpWriterContextTest, FormatsGridTable)
+{
+    const char *const text[] = {
+        "Grid table:",
+        "",
+        "+--------------+---------------+",
+        "| First column | Second header |",
+        "+--------------+---------------+",
+        "| text         | text          |",
+        "+--------------+---------------+",
+        "",
+        "Normal paragraph",
+        "again."
+    };
+    testFormatting(text);
+}
+
+TEST_F(HelpWriterContextTest, FormatsTitles)
+{
+    const char *const text[] = {
+        "Title",
+        "=====",
+        "Some text without spacing",
+        "",
+        "Subtitle",
+        "++++++++",
+        "",
+        "More text",
+    };
+    testFormatting(text);
+}
+
 } // namespace
diff --git a/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsGridTable.xml b/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsGridTable.xml
new file mode 100644 (file)
index 0000000..8b7deab
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Console"><![CDATA[
+Grid table:
+
++--------------+---------------+
+| First column | Second header |
++--------------+---------------+
+| text         | text          |
++--------------+---------------+
+
+Normal paragraph again.]]></String>
+  <String Name="reStructuredText"><![CDATA[
+Grid table:
+
++--------------+---------------+
+| First column | Second header |
++--------------+---------------+
+| text         | text          |
++--------------+---------------+
+
+Normal paragraph
+again.]]></String>
+</ReferenceData>
diff --git a/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsLiteralTextWithIndentation.xml b/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsLiteralTextWithIndentation.xml
new file mode 100644 (file)
index 0000000..6fbc448
--- /dev/null
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Console"><![CDATA[
+Sample paragraph:
+
+    literal block
+      another indented line
+
+Normal paragraph with wrapping]]></String>
+  <String Name="reStructuredText"><![CDATA[
+Sample paragraph::
+
+    literal block
+      another indented line
+
+Normal paragraph
+with wrapping]]></String>
+</ReferenceData>
diff --git a/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsSimpleTable.xml b/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsSimpleTable.xml
new file mode 100644 (file)
index 0000000..c1d0bb3
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Console"><![CDATA[
+Simple table:
+
+============  =============
+First column  Second header
+============  =============
+text          text
+============  =============
+
+Normal paragraph again.]]></String>
+  <String Name="reStructuredText"><![CDATA[
+Simple table:
+
+============  =============
+First column  Second header
+============  =============
+text          text
+============  =============
+
+Normal paragraph
+again.]]></String>
+</ReferenceData>
diff --git a/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsTitles.xml b/src/gromacs/onlinehelp/tests/refdata/HelpWriterContextTest_FormatsTitles.xml
new file mode 100644 (file)
index 0000000..3a03ef4
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="Console"><![CDATA[
+Title
+=====
+Some text without spacing
+
+Subtitle
+++++++++
+
+More text]]></String>
+  <String Name="reStructuredText"><![CDATA[
+Title
+=====
+Some text without spacing
+
+Subtitle
+++++++++
+
+More text]]></String>
+</ReferenceData>
index 6e1348a554b2ca898623b6bc297155adf0f96e28..fc7b29a968e9f8b9844f66854f703541356b00b2 100644 (file)
@@ -108,7 +108,7 @@ pbc_correct_dx_simd(gmx_simd_real_t  *dx,
 {
     gmx_simd_real_t shz, shy, shx;
 
-#if defined _MSC_VER && _MSC_VER < 1700
+#if defined _MSC_VER && _MSC_VER < 1700 && !defined(__ICL)
     /* The caller side should make sure we never end up here.
      * TODO Black-list _MSC_VER < 1700 when it's old enough, so we can rid
      * of this code complication.
index 87ab39f543d0819c7a4c94459f91073effcd0847..dde38d816e56cc7d02518fa58c8ae2d2b388d8ec 100644 (file)
@@ -1872,11 +1872,6 @@ init_method(const SelectionTreeElementPointer &sel, t_topology *top, int isize)
                                "Output initialization must be provided for "
                                "SMETH_VARNUMVAL selection methods");
             alloc_selection_data(sel, isize, true);
-            if ((sel->flags & SEL_DYNAMIC)
-                && sel->v.type != GROUP_VALUE && sel->v.type != POS_VALUE)
-            {
-                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)
             {
@@ -1897,16 +1892,6 @@ init_method(const SelectionTreeElementPointer &sel, t_topology *top, int isize)
                 }
             }
         }
-        /* Clear the values for dynamic output to avoid valgrind warnings. */
-        if ((sel->flags & SEL_DYNAMIC) && sel->v.type == REAL_VALUE)
-        {
-            int i;
-
-            for (i = 0; i < sel->v.nr; ++i)
-            {
-                sel->v.u.r[i] = 0.0;
-            }
-        }
     }
 }
 
@@ -2146,8 +2131,10 @@ analyze_static(gmx_sel_evaluate_t                *data,
 
         case SEL_EXPRESSION:
         case SEL_MODIFIER:
+        {
+            const int isize = g ? g->isize : 0;
             _gmx_sel_evaluate_method_params(data, sel, g);
-            init_method(sel, data->top, g ? g->isize : 0);
+            init_method(sel, data->top, isize);
             if (!(sel->flags & SEL_DYNAMIC))
             {
                 sel->cdata->evaluate(data, sel, g);
@@ -2165,13 +2152,29 @@ analyze_static(gmx_sel_evaluate_t                *data,
                 {
                     sel->cdata->evaluate(data, sel, g);
                 }
+                else
+                {
+                    if (sel->v.type != GROUP_VALUE && sel->v.type != POS_VALUE)
+                    {
+                        sel->v.nr = ((sel->flags & SEL_SINGLEVAL) ? 1 : isize);
+                    }
+                    // Clear the values for dynamic output to avoid
+                    // uninitialized memory.
+                    if (sel->v.type == REAL_VALUE)
+                    {
+                        for (int i = 0; i < sel->v.nr; ++i)
+                        {
+                            sel->v.u.r[i] = 0.0;
+                        }
+                    }
+                }
                 if (bDoMinMax && g)
                 {
                     gmx_ana_index_copy(sel->cdata->gmax, g, true);
                 }
             }
             break;
-
+        }
         case SEL_BOOLEAN:
             if (!(sel->flags & SEL_DYNAMIC))
             {
index ebbf77aec775e79d548a95f2313bd88c1351da83..bed7790e3be75a20668e00231d89499604dd273b 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.
@@ -468,13 +468,4 @@ gmx_simd4_dotproduct3_f_ibm_qpx(vector4double a, vector4double b)
     return (float)gmx_simd4_dotproduct3_d_ibm_qpx(a, b);
 }
 
-/* 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_QPX_H */
index 66b2986925a9a607111339765f235549de6e1196..3f35a7fce8b246c867684eb92249bd24ea48d3a1 100644 (file)
@@ -348,13 +348,4 @@ gmx_simd4_dotproduct3_f_ibm_vmx(gmx_simd4_float_t a, gmx_simd4_float_t b)
     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 */
index ca8fb1ba5c3065115f5a19291ee781c890e960ed..d5fb5483d9bd943838071de774bdc7dbfd80640e 100644 (file)
@@ -615,15 +615,6 @@ gmx_simd4_dotproduct3_f_ibm_vsx(gmx_simd4_float_t a, gmx_simd4_float_t b)
     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
index 1840c772753c7dfb5cfc58e71d2e9214cd1817f8..0fd51fb3992525e8b0d97207bfd64788026fc6b6 100644 (file)
@@ -555,28 +555,4 @@ gmx_simd_log_f_mic(__m512 x)
     return _mm512_mul_ps(_mm512_set1_ps(0.693147180559945286226764), _mm512_log2ae23_ps(x));
 }
 
-/* Function to check whether SIMD operations have resulted in overflow */
-static int
-gmx_simd_check_and_reset_overflow(void)
-{
-    int                MXCSR;
-    int                sse_overflow;
-    /* The overflow flag is bit 3 in the register */
-    const unsigned int flag = 0x8;
-
-    MXCSR = _mm_getcsr();
-    if (MXCSR & flag)
-    {
-        sse_overflow = 1;
-        /* Set the overflow flag to zero */
-        MXCSR = MXCSR & ~flag;
-        _mm_setcsr(MXCSR);
-    }
-    else
-    {
-        sse_overflow = 0;
-    }
-    return sse_overflow;
-}
-
 #endif /* GMX_SIMD_IMPL_INTEL_MIC_H */
index c4f6f776caa1aa353d1ae14dcd62b1a75be866aa..05d73f34d35de579e045e27aab3b0730e6cc3426 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.
@@ -3693,18 +3693,6 @@ gmx_simd4_dotproduct3_d(gmx_simd_double_t a, gmx_simd_double_t b)
 /*! \} */
 
 
-/*! \brief Return 1 if SIMD floating-point ops have overflowed, and reset check.
-
- * This function to check whether SIMD operations have resulted in overflow,
- * and returns 1 if it occured, 0 otherwise.
- * For now, this is unfortunately a dummy for all architectures except x86.
- */
-static int
-gmx_simd_check_and_reset_overflow(void)
-{
-    return 0;
-}
-
 /*! \} */
 /*! \endcond */
 
index 8e2671a321edb5043852cd742a7dd4fa84369d7b..499882a1051a1c28cdd384f44d69f8951a394237 100644 (file)
@@ -539,28 +539,5 @@ gmx_simd4_dotproduct3_d_avx_256(__m256d a, __m256d b)
     return d;
 }
 
-/* Function to check whether SIMD operations have resulted in overflow */
-static int
-gmx_simd_check_and_reset_overflow(void)
-{
-    int MXCSR;
-    int sse_overflow;
-
-    MXCSR = _mm_getcsr();
-    /* The overflow flag is bit 3 in the register */
-    if (MXCSR & 0x0008)
-    {
-        sse_overflow = 1;
-        /* Set the overflow flag to zero */
-        MXCSR = MXCSR & 0xFFF7;
-        _mm_setcsr(MXCSR);
-    }
-    else
-    {
-        sse_overflow = 0;
-    }
-    return sse_overflow;
-}
-
 
 #endif /* GMX_SIMD_IMPL_X86_AVX_256_H */
index fac0b6f84a651d88be7106d5e051ba29eb2c23d3..0f7b387dd7e94fd649ffbc0962415b4dba6b03b5 100644 (file)
@@ -491,28 +491,4 @@ gmx_simd4_dotproduct3_d_x86_avx_512f(__m256d a, __m256d b)
     return d;
 }
 
-/* Function to check whether SIMD operations have resulted in overflow */
-static int
-gmx_simd_check_and_reset_overflow(void)
-{
-    int                MXCSR;
-    int                sse_overflow;
-    /* The overflow flag is bit 3 in the register */
-    const unsigned int flag = 0x8;
-
-    MXCSR = _mm_getcsr();
-    if (MXCSR & flag)
-    {
-        sse_overflow = 1;
-        /* Set the overflow flag to zero */
-        MXCSR = MXCSR & ~flag;
-        _mm_setcsr(MXCSR);
-    }
-    else
-    {
-        sse_overflow = 0;
-    }
-    return sse_overflow;
-}
-
 #endif /* GMX_SIMD_IMPL_X86_AVX_512F_H */
index 90aac616a13f21305e38bae5bc79eb58b53c9ba6..3151d97b3f16950fc7b7a00e9df8b23488edeec7 100644 (file)
@@ -373,29 +373,6 @@ gmx_simd_reduce_d_sse2(__m128d a)
     return f;
 }
 
-/* Function to check whether SIMD operations have resulted in overflow */
-static int
-gmx_simd_check_and_reset_overflow(void)
-{
-    int MXCSR;
-    int sse_overflow;
-
-    MXCSR = _mm_getcsr();
-    /* The overflow flag is bit 3 in the register */
-    if (MXCSR & 0x0008)
-    {
-        sse_overflow = 1;
-        /* Set the overflow flag to zero */
-        MXCSR = MXCSR & 0xFFF7;
-        _mm_setcsr(MXCSR);
-    }
-    else
-    {
-        sse_overflow = 0;
-    }
-    return sse_overflow;
-}
-
 /* SSE2 is already 4-wide in single, so we just reuse float datatype for SIMD4.
  * SSE2 cannot do double-precision SIMD4.
  */
index 8e6560ed26f797b17e44cf4abceceedbc2e1c069..b3d2fbe5dcb4edf33f76788454656bd63d91df4a 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.
@@ -55,7 +55,7 @@ extern "C"
 extern const char _gmx_ver_string[];
 //! Full git hash of the latest commit.
 extern const char _gmx_full_git_hash[];
-//! Full git hash of the latest commit in a central Gromacs repository.
+//! Full git hash of the latest commit in a central \Gromacs repository.
 extern const char _gmx_central_base_hash[];
 
 //! \}
index 81efa86870b212326be4bf1c1623354bf26efa3d..1a9cd02901351b935df4d657d84fc68cd75b5297 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) 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.
@@ -161,19 +161,19 @@ class Regex::Impl
         explicit Impl(const char * /*value*/)
         {
             GMX_THROW(NotImplementedError(
-                              "Gromacs is compiled without regular expression support"));
+                              "GROMACS is compiled without regular expression support"));
         }
         explicit Impl(const std::string & /*value*/)
         {
             GMX_THROW(NotImplementedError(
-                              "Gromacs is compiled without regular expression support"));
+                              "GROMACS is compiled without regular expression support"));
         }
 
         bool match(const char * /*value*/) const
         {
             // Should never be reached.
             GMX_THROW(NotImplementedError(
-                              "Gromacs is compiled without regular expression support"));
+                              "GROMACS is compiled without regular expression support"));
         }
 };
 #endif
index dbcb951486f652c23680744fc9a30abef2ccd000..86abf82a085e9c370569609e6a6d188f994eb06f 100644 (file)
@@ -323,7 +323,11 @@ TextLineWrapper::formatLine(const std::string &input,
         --lineEnd;
     }
 
-    size_t      lineLength = lineEnd - lineStart;
+    const size_t lineLength = lineEnd - lineStart;
+    if (lineLength == 0)
+    {
+        return std::string();
+    }
     std::string result(indent, ' ');
     result.append(input, lineStart, lineLength);
     if (bContinuation && settings_.continuationChar_ != '\0')
diff --git a/src/gromacs/utility/tests/refdata/TextLineWrapperTest_HandlesIndentWithEmptyLines.xml b/src/gromacs/utility/tests/refdata/TextLineWrapperTest_HandlesIndentWithEmptyLines.xml
new file mode 100644 (file)
index 0000000..edb38af
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <String Name="WrappedWithNoLimit"><![CDATA[
+  A quick brown fox jumps
+
+  over the lazy dog]]></String>
+  <String Name="WrappedAt14"><![CDATA[
+  A quick brown
+  fox jumps
+
+  over the lazy
+  dog]]></String>
+</ReferenceData>
index 5f9fb1e31a997da846fdaa56c6994bec502f671d..ba1683d06d236ae5a99f15c9506bb203c601a243 100644 (file)
@@ -238,6 +238,8 @@ TEST(ReplaceAllTest, HandlesPossibleRecursiveMatches)
 const char g_wrapText[] = "A quick brown fox jumps over the lazy dog";
 //! Test string for wrapping with embedded line breaks.
 const char g_wrapText2[] = "A quick brown fox jumps\nover the lazy dog";
+//! Test string for wrapping with embedded line breaks and an empty line.
+const char g_wrapText3[] = "A quick brown fox jumps\n\nover the lazy dog";
 //! Test string for wrapping with a long word.
 const char g_wrapTextLongWord[]
     = "A quick brown fox jumps awordthatoverflowsaline over the lazy dog";
@@ -331,6 +333,16 @@ TEST_F(TextLineWrapperTest, HandlesIndent)
     checkText(wrapper.wrapToString(g_wrapText2), "WrappedAt14");
 }
 
+TEST_F(TextLineWrapperTest, HandlesIndentWithEmptyLines)
+{
+    gmx::TextLineWrapper wrapper;
+    wrapper.settings().setIndent(2);
+
+    checkText(wrapper.wrapToString(g_wrapText3), "WrappedWithNoLimit");
+    wrapper.settings().setLineLength(16);
+    checkText(wrapper.wrapToString(g_wrapText3), "WrappedAt14");
+}
+
 TEST_F(TextLineWrapperTest, HandlesHangingIndent)
 {
     gmx::TextLineWrapper wrapper;
index 8bd53d39db270ec0f09be530c155b181cb566215..20bd108c44767ff3905ddcc7dbdb3cc2fe23b918 100644 (file)
@@ -105,7 +105,7 @@ class ObsoleteToolModule : public gmx::CommandLineModuleInterface
         void printMessage() const
         {
             std::fprintf(stderr,
-                         "This tool has been removed from Gromacs 5.0. Please see\n"
+                         "This tool is no longer present in GROMACS. Please see\n"
                          "  http://www.gromacs.org/Documentation/How-tos/Tool_Changes_for_5.0\n"
                          "for ideas how to perform the same tasks with the "
                          "new tools.\n");
index 62e1f59a98e0ee7290399691e398e8c0b07fdaec..508f6d03b6101dae7225c5298acba6dd6c497266 100644 (file)
@@ -166,7 +166,7 @@ int gmx_mdrun(int argc, char *argv[])
         "with the step number.",
         "A simulation can be continued by reading the full state from file",
         "with option [TT]-cpi[tt]. This option is intelligent in the way that",
-        "if no checkpoint file is found, Gromacs just assumes a normal run and",
+        "if no checkpoint file is found, GROMACS just assumes a normal run and",
         "starts from the first step of the [REF].tpr[ref] file. By default the output",
         "will be appending to the existing output files. The checkpoint file",
         "contains checksums of all output files, such that you will never",
index 4422b7a13d450510957a425955e3279da9562da2..ffa7a8df29037f2f94685d88b20eefad9d78b77b 100644 (file)
@@ -772,18 +772,18 @@ static void check_and_update_hw_opt_1(gmx_hw_opt_t *hw_opt,
 #ifndef GMX_THREAD_MPI
     if (hw_opt->nthreads_tot > 0)
     {
-        gmx_fatal(FARGS, "Setting the total number of threads is only supported with thread-MPI and Gromacs was compiled without thread-MPI");
+        gmx_fatal(FARGS, "Setting the total number of threads is only supported with thread-MPI and GROMACS was compiled without thread-MPI");
     }
     if (hw_opt->nthreads_tmpi > 0)
     {
-        gmx_fatal(FARGS, "Setting the number of thread-MPI threads is only supported with thread-MPI and Gromacs was compiled without thread-MPI");
+        gmx_fatal(FARGS, "Setting the number of thread-MPI threads is only supported with thread-MPI and GROMACS was compiled without thread-MPI");
     }
 #endif
 
 #ifndef GMX_OPENMP
     if (hw_opt->nthreads_omp > 1)
     {
-        gmx_fatal(FARGS, "More than 1 OpenMP thread requested, but Gromacs was compiled without OpenMP support");
+        gmx_fatal(FARGS, "More than 1 OpenMP thread requested, but GROMACS was compiled without OpenMP support");
     }
     hw_opt->nthreads_omp = 1;
 #endif
@@ -825,7 +825,7 @@ static void check_and_update_hw_opt_1(gmx_hw_opt_t *hw_opt,
 #ifndef GMX_OPENMP
     if (hw_opt->nthreads_omp > 1)
     {
-        gmx_fatal(FARGS, "OpenMP threads are requested, but Gromacs was compiled without OpenMP support");
+        gmx_fatal(FARGS, "OpenMP threads are requested, but GROMACS was compiled without OpenMP support");
     }
 #endif
 
@@ -1358,7 +1358,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     if (MULTISIM(cr))
     {
         md_print_info(cr, fplog,
-                      "This is simulation %d out of %d running as a composite Gromacs\n"
+                      "This is simulation %d out of %d running as a composite GROMACS\n"
                       "multi-simulation job. Setup for this simulation:\n\n",
                       cr->ms->sim, cr->ms->nsim);
     }
index 567b522564a2568129b439c9cabc51db3f843aa1..7690b98ad78830bd2244e30b1d91baac8d59bf41 100644 (file)
@@ -3,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.
@@ -276,7 +276,7 @@ static t_mentry  DispMenu[] = {
 
 static t_mentry  HelpMenu[] = {
     { 0,  IDHELP,     false,  "Help"             },
-    { 0,  IDABOUT,    false,  "About Gromacs..." }
+    { 0,  IDABOUT,    false,  "About GROMACS..." }
 };
 
 static t_mentry *gmx_pd[] = { FileMenu, DispMenu, HelpMenu };