Merge release-5-0 into master
authorRoland Schulz <roland@utk.edu>
Wed, 3 Sep 2014 17:47:25 +0000 (13:47 -0400)
committerRoland Schulz <roland@utk.edu>
Wed, 3 Sep 2014 22:10:20 +0000 (18:10 -0400)
Conflicts:
cmake/gmxDetectSimd.cmake
cmake/gmxSetBuildInformation.cmake
share/template/cmake/FindGROMACS.cmakein
change superseded in master
src/gromacs/fileio/mdoutf.h
src/gromacs/gmxlib/network.c
src/gromacs/gmxlib/oenv.cpp
src/gromacs/legacyheaders/types/simple.h
change applied to
src/gromacs/utility/real.h

Change-Id: Ib076dc9894f0d590a243a7504c3db7daf2f72beb

33 files changed:
1  2 
CMakeLists.txt
cmake/gmxCFlags.cmake
cmake/gmxDetectSimd.cmake
cmake/gmxSetBuildInformation.cmake
docs/install-guide/install-guide.md
src/config.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/fileio/mdoutf.c
src/gromacs/fileio/mdoutf.h
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tngio_for_tools.cpp
src/gromacs/fileio/trajectory_writing.c
src/gromacs/fileio/trajectory_writing.h
src/gromacs/gmxana/gmx_bar.c
src/gromacs/gmxana/gmx_covar.c
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/gmxlib/oenv.cpp
src/gromacs/gmxpreprocess/calc_verletbuf.c
src/gromacs/legacyheaders/sim_util.h
src/gromacs/legacyheaders/vsite.h
src/gromacs/mdlib/domdec.c
src/gromacs/mdlib/minimize.c
src/gromacs/mdlib/pme.c
src/gromacs/mdlib/sim_util.c
src/gromacs/mdlib/vsite.c
src/gromacs/utility/basenetwork.cpp
src/gromacs/utility/real.h
src/gromacs/utility/smalloc.c
src/programs/mdrun/md.cpp
src/programs/mdrun/tests/rerun.cpp
src/testutils/tests/testasserts_tests.cpp

diff --cc CMakeLists.txt
index ce27e95cc1aa3c395bf6e2a00234fc5ff225a8f1,ce678e504ce1852319479944a09d0a820f73c36d..5aafe926ada829b58ebc622faf85d92c0458ffe4
@@@ -520,6 -596,19 +520,13 @@@ if (GMX_BUILD_UNITTESTS AND NOT HAVE_LI
          "Either set GMX_BUILD_UNITTESTS=OFF or tell CMake how to find a working version of libxml2.")
  endif()
  
 -########################################################################
 -# Generate development version info for cache
 -########################################################################
 -# set(GEN_VERSION_INFO_INTERNAL "ON")
 -# include(gmxGenerateVersionString)
 -
+ if(GMX_USE_TNG AND NOT GMX_EXTERNAL_TNG)
+     # TNG wants zlib if it is available
+     find_package(ZLIB QUIET)
+     include(gmxTestZLib)
+     gmx_test_zlib(HAVE_ZLIB)
+ endif()
  ########################################################################
  # Our own GROMACS tests
  ########################################################################
Simple merge
index 4edfe14dd3b93977c2e9078820e4e587af9c98db,a2ac397c4c919699fd7e10df08ed42ff91ece3a7..a8ac28260544cf0ddaa490571bee82a348bce7d2
@@@ -62,7 -62,7 +62,7 @@@ function(gmx_suggest_x86_simd _suggeste
      message(STATUS "Detecting best SIMD instructions for this CPU")
  
      # Get CPU SIMD properties information
-     set(_compile_definitions "@GCC_INLINE_ASM_DEFINE@ -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
 -    set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders -DGMX_CPUID_STANDALONE")
++    set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
      if(GMX_TARGET_X86)
          set(_compile_definitions "${_compile_definitions} -DGMX_TARGET_X86")
      endif()
index 04a03bfb0b874f7ce490512f53e873df1aae8805,d7add47d207b812a449633f708a9559f3438fe83..7565410844fef9f73ab6f3b5e52f50cbea2fe026
@@@ -83,7 -83,7 +83,7 @@@ macro(gmx_set_build_information
  
      if(NOT CMAKE_CROSSCOMPILING)
          # Get CPU information, e.g. for deciding what SIMD support exists
-         set(_compile_definitions "@GCC_INLINE_ASM_DEFINE@ -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
 -        set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders -DGMX_CPUID_STANDALONE")
++        set(_compile_definitions "${GCC_INLINE_ASM_DEFINE} -I${CMAKE_SOURCE_DIR}/src -DGMX_CPUID_STANDALONE")
          if(GMX_TARGET_X86)
              set(_compile_definitions "${_compile_definitions} -DGMX_TARGET_X86")
          endif()
Simple merge
Simple merge
Simple merge
index da67416fb8cff3fb84018827b35db4612fac55ec,1118cc06531bdd388470fd99a25449cb92f9614e..4532b7d65b1ee1b9a9290fc8efece4a83328c680
  #include "xtcio.h"
  #include "tngio.h"
  #include "trajectory_writing.h"
 -#include "checkpoint.h"
 -#include "copyrite.h"
 +#include "gromacs/legacyheaders/checkpoint.h"
 +#include "gromacs/legacyheaders/copyrite.h"
  
 -#include "gromacs/legacyheaders/gmx_fatal.h"
 +#include "gromacs/fileio/xvgr.h"
 +#include "gromacs/math/vec.h"
 +#include "gromacs/utility/fatalerror.h"
  #include "gromacs/utility/smalloc.h"
+ #include "gromacs/timing/wallcycle.h"
  
  struct gmx_mdoutf {
      t_fileio         *fp_trn;
index 645ecab6f09d966be56dec3062283410aee2a7ab,a063c1fd8f0d5a4c87a901d97e89876d58b753f4..7c9f2a3309188c12cbf4f7fd1b7f725b25c6355a
  #include "../legacyheaders/types/inputrec.h"
  #include "../legacyheaders/types/oenv.h"
  #include "../legacyheaders/network.h"
 +
 +#include "../math/vectypes.h"
++#include "../timing/wallcycle.h"
 +#include "../utility/basedefinitions.h"
  #include "filenm.h"
  #include "enxio.h"
  
@@@ -66,8 -58,9 +67,9 @@@ gmx_mdoutf_t init_mdoutf(FIL
                           int                mdrun_flags,
                           const t_commrec   *cr,
                           const t_inputrec  *ir,
 -                         gmx_mtop_t        *mtop,
 +                         struct gmx_mtop_t *mtop,
-                          const output_env_t oenv);
+                          const output_env_t oenv,
+                          gmx_wallcycle_t    wcycle);
  
  /*! \brief Getter for file pointer */
  FILE *mdoutf_get_fp_field(gmx_mdoutf_t of);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 3241c0bfc63da12c88edf6b045972e886f5d1188,01eda5251e052252720b8f6c50a5dea05c5a4e8a..d7fcc05037414e3762aaf20921bcf46151ce319d
@@@ -195,17 -202,42 +195,21 @@@ xvg_format_t output_env_get_xvg_format(
      return oenv->xvg_format;
  }
  
 -const char *output_env_get_program_name(const output_env_t oenv)
 +const char *output_env_get_program_display_name(const output_env_t oenv)
  {
 -    const char *programName = NULL;
++    const char *displayName = NULL;
      try
      {
-         return oenv->programContext.displayName();
 -        programName = oenv->programContext.fullBinaryPath();
++        displayName = oenv->programContext.displayName();
      }
      GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 -    return programName;
++    return displayName;
  }
  
 -const char *output_env_get_short_program_name(const output_env_t oenv)
 +const gmx::ProgramContextInterface &
 +output_env_get_program_context(const output_env_t oenv)
  {
 -    const char *programName = NULL;
 -
 -    try
 -    {
 -        // TODO: Use the display name once it doesn't break anything.
 -        programName = oenv->programContext.programName();
 -    }
 -    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 -
 -    return programName;
 -}
 -
 -const char *output_env_get_cmd_line(const output_env_t oenv)
 -{
 -    const char *commandLine = NULL;
 -
 -    try
 -    {
 -        commandLine = oenv->programContext.commandLine();
 -    }
 -    GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 -
 -    return commandLine;
 +    return oenv->programContext;
  }
index 70acb1910bbd778a7b6b2ed36079206b61bb442b,e5eb4685886dbf111cabe9e77311d85fdb7c9ad0..b7f94dea7fd5af1d40ded346bd7c75288d89eb1e
@@@ -136,11 -133,10 +136,12 @@@ void init_md(FILE *fplog
               gmx_mdoutf_t *outf, t_mdebin **mdebin,
               tensor force_vir, tensor shake_vir,
               rvec mu_tot,
-              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags);
+              gmx_bool *bSimAnn, t_vcm **vcm, unsigned long Flags,
+              gmx_wallcycle_t wcycle);
  /* Routine in sim_util.c */
  
 +gmx_bool use_GPU(const struct nonbonded_verlet_t *nbv);
 +
  #ifdef __cplusplus
  }
  #endif
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b1747df93b544d4d293bd884d7c14e7ea60c8112,0000000000000000000000000000000000000000..8c7bffbf542b77c827a515ccba1a9522cce6d95e
mode 100644,000000..100644
--- /dev/null
@@@ -1,268 -1,0 +1,277 @@@
 +/*
 + * This file is part of the GROMACS molecular simulation package.
 + *
 + * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
 + * Copyright (c) 2001-2004, The GROMACS development team.
 + * Copyright (c) 2013,2014, by the GROMACS development team, led by
 + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 + * and including many others, as listed in the AUTHORS file in the
 + * top-level source directory and at http://www.gromacs.org.
 + *
 + * GROMACS is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public License
 + * as published by the Free Software Foundation; either version 2.1
 + * of the License, or (at your option) any later version.
 + *
 + * GROMACS is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with GROMACS; if not, see
 + * http://www.gnu.org/licenses, or write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 + *
 + * If you want to redistribute modifications to GROMACS, please
 + * consider that scientific software is very special. Version
 + * control is crucial - bugs must be traceable. We will be happy to
 + * consider code for inclusion in the official distribution, but
 + * derived work must not be called official GROMACS. Details are found
 + * in the README & COPYING files - if they are missing, get the
 + * official version at http://www.gromacs.org.
 + *
 + * To help us fund GROMACS development, we humbly ask that you cite
 + * the research papers on the package. Check out http://www.gromacs.org.
 + */
 +#include "gmxpre.h"
 +
 +#include "basenetwork.h"
 +
 +#include "config.h"
 +
 +#include <cctype>
 +#include <cstdio>
 +#include <cstdlib>
 +#include <cstring>
 +
 +#include <algorithm>
 +#include <exception>
 +
 +#ifdef HAVE_UNISTD_H
 +#include <unistd.h>
 +#endif
 +
 +#include "gromacs/utility/cstringutil.h"
 +#include "gromacs/utility/fatalerror.h"
 +#include "gromacs/utility/gmxmpi.h"
 +#include "gromacs/utility/programcontext.h"
 +
 +int gmx_gethostname(char *name, size_t len)
 +{
 +    if (len < 8)
 +    {
 +        gmx_incons("gmx_gethostname called with len<8");
 +    }
 +#if defined(HAVE_UNISTD_H) && !defined(__native_client__)
 +    if (gethostname(name, len-1) != 0)
 +    {
 +        std::strncpy(name, "unknown", 8);
 +        return -1;
 +    }
 +    return 0;
 +#else
 +    std::strncpy(name, "unknown", 8);
 +    return -1;
 +#endif
 +}
 +
 +gmx_bool gmx_mpi_initialized(void)
 +{
 +#ifndef GMX_MPI
 +    return 0;
 +#else
 +    int n;
 +    MPI_Initialized(&n);
 +
 +    return n;
 +#endif
 +}
 +
 +int gmx_node_num(void)
 +{
 +#ifndef GMX_MPI
 +    return 1;
 +#else
 +#ifdef GMX_THREAD_MPI
 +    if (!gmx_mpi_initialized())
 +    {
 +        return 1;
 +    }
 +#endif
 +    int i;
 +    (void) MPI_Comm_size(MPI_COMM_WORLD, &i);
 +    return i;
 +#endif
 +}
 +
 +int gmx_node_rank(void)
 +{
 +#ifndef GMX_MPI
 +    return 0;
 +#else
 +#ifdef GMX_THREAD_MPI
 +    if (!gmx_mpi_initialized())
 +    {
 +        return 0;
 +    }
 +#endif
 +    int i;
 +    (void) MPI_Comm_rank(MPI_COMM_WORLD, &i);
 +    return i;
 +#endif
 +}
 +
 +static int mpi_hostname_hash(void)
 +{
 +    int hash_int;
 +
 +#ifndef GMX_LIB_MPI
 +    /* We have a single physical node */
 +    hash_int = 0;
 +#else
 +    int  resultlen;
 +    char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
 +
 +    /* This procedure can only differentiate nodes with different names.
 +     * Architectures where different physical nodes have identical names,
 +     * such as IBM Blue Gene, should use an architecture specific solution.
 +     */
 +    MPI_Get_processor_name(mpi_hostname, &resultlen);
 +
 +    /* The string hash function returns an unsigned int. We cast to an int.
 +     * Negative numbers are converted to positive by setting the sign bit to 0.
 +     * This makes the hash one bit smaller.
 +     * A 63-bit hash (with 64-bit int) should be enough for unique node hashes,
 +     * even on a million node machine. 31 bits might not be enough though!
 +     */
 +    hash_int =
 +        (int)gmx_string_fullhash_func(mpi_hostname, gmx_string_hash_init);
 +    if (hash_int < 0)
 +    {
 +        hash_int -= INT_MIN;
 +    }
 +#endif
 +
 +    return hash_int;
 +}
 +
 +#if defined GMX_LIB_MPI && defined GMX_TARGET_BGQ
++#ifdef __clang__
++/* IBM's declaration of this function in
++ * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
++ * erroneously fails to specify __INLINE__, despite
++ * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h
++ * specifiying __INLINE__, so bgclang thinks they are different enough
++ * to complain about. */
++static uint64_t Kernel_GetJobID();
++#endif
 +#include <spi/include/kernel/location.h>
 +
 +static int bgq_nodenum(void)
 +{
 +    int           hostnum;
 +    Personality_t personality;
 +    Kernel_GetPersonality(&personality, sizeof(personality));
 +    /* Each MPI rank has a unique coordinate in a 6-dimensional space
 +       (A,B,C,D,E,T), with dimensions A-E corresponding to different
 +       physical nodes, and T within each node. Each node has sixteen
 +       physical cores, each of which can have up to four hardware
 +       threads, so 0 <= T <= 63 (but the maximum value of T depends on
 +       the confituration of ranks and OpenMP threads per
 +       node). However, T is irrelevant for computing a suitable return
 +       value for gmx_hostname_num().
 +     */
 +    hostnum  = personality.Network_Config.Acoord;
 +    hostnum *= personality.Network_Config.Bnodes;
 +    hostnum += personality.Network_Config.Bcoord;
 +    hostnum *= personality.Network_Config.Cnodes;
 +    hostnum += personality.Network_Config.Ccoord;
 +    hostnum *= personality.Network_Config.Dnodes;
 +    hostnum += personality.Network_Config.Dcoord;
 +    hostnum *= personality.Network_Config.Enodes;
 +    hostnum += personality.Network_Config.Ecoord;
 +
 +    if (debug)
 +    {
 +        std::fprintf(debug,
 +                     "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\n"
 +                     "Node ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
 +                     personality.Network_Config.Acoord,
 +                     personality.Network_Config.Anodes,
 +                     personality.Network_Config.Bcoord,
 +                     personality.Network_Config.Bnodes,
 +                     personality.Network_Config.Ccoord,
 +                     personality.Network_Config.Cnodes,
 +                     personality.Network_Config.Dcoord,
 +                     personality.Network_Config.Dnodes,
 +                     personality.Network_Config.Ecoord,
 +                     personality.Network_Config.Enodes,
 +                     Kernel_ProcessorCoreID(),
 +                     16,
 +                     Kernel_ProcessorID(),
 +                     64,
 +                     Kernel_ProcessorThreadID(),
 +                     4);
 +    }
 +    return hostnum;
 +}
 +#endif
 +
 +int gmx_physicalnode_id_hash(void)
 +{
 +    int hash;
 +
 +#ifndef GMX_MPI
 +    hash = 0;
 +#else
 +#ifdef GMX_THREAD_MPI
 +    /* thread-MPI currently puts the thread number in the process name,
 +     * we might want to change this, as this is inconsistent with what
 +     * most MPI implementations would do when running on a single node.
 +     */
 +    hash = 0;
 +#else
 +#ifdef GMX_TARGET_BGQ
 +    hash = bgq_nodenum();
 +#else
 +    hash = mpi_hostname_hash();
 +#endif
 +#endif
 +#endif
 +
 +    if (debug)
 +    {
 +        fprintf(debug, "In gmx_physicalnode_id_hash: hash %d\n", hash);
 +    }
 +
 +    return hash;
 +}
 +
 +#ifdef GMX_LIB_MPI
 +void gmx_abort(int errorno)
 +{
 +    const char *programName = "GROMACS";
 +    try
 +    {
 +        programName = gmx::getProgramContext().displayName();
 +    }
 +    catch (const std::exception &)
 +    {
 +    }
 +    const int nnodes   = gmx_node_num();
 +    const int noderank = gmx_node_rank();
 +    if (nnodes > 1)
 +    {
 +        std::fprintf(stderr, "Halting parallel program %s on rank %d out of %d\n",
 +                     programName, noderank, nnodes);
 +    }
 +    else
 +    {
 +        std::fprintf(stderr, "Halting program %s\n", programName);
 +    }
 +
 +    MPI_Abort(MPI_COMM_WORLD, errorno);
 +    std::exit(errorno);
 +}
 +#endif
index a8fb5a52deec970017af31f1f15437b9bc0fccb8,0000000000000000000000000000000000000000..e8a3ae18e7702dc765c24ddc2564438e8a875b67
mode 100644,000000..100644
--- /dev/null
@@@ -1,115 -1,0 +1,138 @@@
- #define GMX_MPI_REAL    MPI_DOUBLE
- #define GMX_REAL_EPS    GMX_DOUBLE_EPS
- #define GMX_REAL_MIN    GMX_DOUBLE_MIN
- #define GMX_REAL_MAX    GMX_DOUBLE_MAX
 +/*
 + * This file is part of the GROMACS molecular simulation package.
 + *
 + * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
 + * Copyright (c) 2001-2004, The GROMACS development team.
 + * Copyright (c) 2013,2014, by the GROMACS development team, led by
 + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 + * and including many others, as listed in the AUTHORS file in the
 + * top-level source directory and at http://www.gromacs.org.
 + *
 + * GROMACS is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public License
 + * as published by the Free Software Foundation; either version 2.1
 + * of the License, or (at your option) any later version.
 + *
 + * GROMACS is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with GROMACS; if not, see
 + * http://www.gnu.org/licenses, or write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 + *
 + * If you want to redistribute modifications to GROMACS, please
 + * consider that scientific software is very special. Version
 + * control is crucial - bugs must be traceable. We will be happy to
 + * consider code for inclusion in the official distribution, but
 + * derived work must not be called official GROMACS. Details are found
 + * in the README & COPYING files - if they are missing, get the
 + * official version at http://www.gromacs.org.
 + *
 + * To help us fund GROMACS development, we humbly ask that you cite
 + * the research papers on the package. Check out http://www.gromacs.org.
 + */
 +/*! \file
 + * \brief
 + * Declares `real` and related constants.
 + *
 + * \inpublicapi
 + * \ingroup module_utility
 + */
 +#ifndef GMX_UTILITY_REAL_H
 +#define GMX_UTILITY_REAL_H
 +
 +/*! \brief Double precision accuracy */
 +#define GMX_DOUBLE_EPS   2.2204460492503131e-16
 +
 +/*! \brief Maximum double precision value - reduced 1 unit in last digit for MSVC */
 +#define GMX_DOUBLE_MAX   1.7976931348623157e+308
 +
 +/*! \brief Minimum double precision value */
 +#define GMX_DOUBLE_MIN   2.2250738585072014e-308
 +
 +/*! \brief Single precision accuracy */
 +#define GMX_FLOAT_EPS    1.19209290e-07F
 +
 +/*! \brief Maximum single precision value - reduced 1 unit in last digit for MSVC */
 +#define GMX_FLOAT_MAX    3.40282346E+38F
 +
 +/*! \brief Minimum single precision value */
 +#define GMX_FLOAT_MIN    1.175494351E-38F
 +
++#ifdef __PGI
++/* The portland group x86 C/C++ compilers do not treat negative zero initializers
++ * correctly, but "optimizes" them to positive zero, so we implement it explicitly.
++ * These constructs are optimized to simple loads at compile time. If you want to
++ * use them on other compilers those have to support gcc preprocessor extensions.
++ * Note: These initializers might be sensitive to the endianness (which can
++ * be different for byte and word order), so check that it works for your platform
++ * and add a separate section if necessary before adding to the ifdef above.
++ */
++#    define GMX_DOUBLE_NEGZERO  ({ const union { int  di[2]; double d; } _gmx_dzero = {0, -2147483648}; _gmx_dzero.d; })
++#    define GMX_FLOAT_NEGZERO   ({ const union { int  fi; float f; } _gmx_fzero = {-2147483648}; _gmx_fzero.f; })
++#else
++/*! \brief Negative zero in double */
++#    define GMX_DOUBLE_NEGZERO  (-0.0)
++
++/*! \brief Negative zero in float */
++#    define GMX_FLOAT_NEGZERO   (-0.0f)
++#endif
 +
 +/*! \typedef real
 + * \brief Precision-dependent \Gromacs floating-point type.
 + */
 +/*! \def HAVE_REAL
 + * \brief Used to check whether `real` is already defined.
 + */
 +/*! \def GMX_MPI_REAL
 + * \brief MPI data type for `real`.
 + */
 +/*! \def GMX_REAL_EPS
 + * \brief Accuracy for `real`.
 + */
 +/*! \def GMX_REAL_MIN
 + * \brief Smallest non-zero value for `real`.
 + */
 +/*! \def GMX_REAL_MAX
 + * \brief Largest finite value for `real`.
 + */
++/*! \def GMX_REAL_NEGZERO
++ * \brief Negative zero for `real`.
++ */
 +/*! \def gmx_real_fullprecision_pfmt
 + * \brief Format string for full `real` precision.
 + */
 +#ifdef GMX_DOUBLE
 +
 +#ifndef HAVE_REAL
 +typedef double      real;
 +#define HAVE_REAL
 +#endif
 +
- #define GMX_MPI_REAL    MPI_FLOAT
- #define GMX_REAL_EPS    GMX_FLOAT_EPS
- #define GMX_REAL_MIN    GMX_FLOAT_MIN
- #define GMX_REAL_MAX    GMX_FLOAT_MAX
++#define GMX_MPI_REAL      MPI_DOUBLE
++#define GMX_REAL_EPS      GMX_DOUBLE_EPS
++#define GMX_REAL_MIN      GMX_DOUBLE_MIN
++#define GMX_REAL_MAX      GMX_DOUBLE_MAX
++#define GMX_REAL_NEGZERO  GMX_DOUBLE_NEGZERO
 +#define gmx_real_fullprecision_pfmt "%21.14e"
 +
 +#else /* GMX_DOUBLE */
 +
 +#ifndef HAVE_REAL
 +typedef float           real;
 +#define HAVE_REAL
 +#endif
 +
++#define GMX_MPI_REAL      MPI_FLOAT
++#define GMX_REAL_EPS      GMX_FLOAT_EPS
++#define GMX_REAL_MIN      GMX_FLOAT_MIN
++#define GMX_REAL_MAX      GMX_FLOAT_MAX
++#define GMX_REAL_NEGZERO  GMX_FLOAT_NEGZERO
 +#define gmx_real_fullprecision_pfmt "%14.7e"
 +
 +#endif /* GMX_DOUBLE */
 +
 +#endif
index 3580a0e0a0c9c8460d7e8f8a4553cbe5830dbd82,3ec2536083b9f48cce715c1360ec5476921821f7..6b45a99a82be08246483cfa8eb7035a6d6cfbf4a
  #include <dmalloc.h>
  #endif
  
 -#include "gromacs/legacyheaders/gmx_fatal.h"
 +#include "thread_mpi/threads.h"
  
 +#include "gromacs/utility/fatalerror.h"
  #ifdef PRINT_ALLOC_KB
 -#include "gromacs/legacyheaders/network.h"
++#include "gromacs/utility/basenetwork.h"
  #include "gromacs/utility/gmxmpi.h"
  #endif
  
Simple merge
Simple merge