Merge release-5-0 into master
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 20 Aug 2014 18:03:25 +0000 (21:03 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 20 Aug 2014 18:04:55 +0000 (21:04 +0300)
Conflicts:
  src/gromacs/legacyheaders/types/simple.h
    - applied gmx_unused change to basedefinitions.h
  src/gromacs/mdlib/sim_util.c
    - took adjacent changes from both branches

Change-Id: I42071be546015ede33b03a34ef0d95a5d5a3b09e

32 files changed:
1  2 
CMakeLists.txt
install-guide/install-guide.md
src/CMakeLists.txt
src/config.h.cmakein
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/histogram.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/fileio/tngio.cpp
src/gromacs/gmxana/gmx_tune_pme.c
src/gromacs/gmxlib/gmx_omp_nthreads.c
src/gromacs/legacyheaders/types/inputrec.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h
src/gromacs/mdlib/sim_util.c
src/gromacs/mdlib/update.c
src/gromacs/pulling/pull.c
src/gromacs/pulling/pullutil.c
src/gromacs/selection/scanner.cpp
src/gromacs/selection/scanner.l
src/gromacs/selection/scanner_flex.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selelem.cpp
src/gromacs/selection/sm_compare.cpp
src/gromacs/selection/tests/nbsearch.cpp
src/gromacs/simd/tests/simd4_math.cpp
src/gromacs/simd/tests/simd_math.cpp
src/gromacs/timing/cyclecounter.h
src/gromacs/timing/wallcycle.c
src/gromacs/timing/wallcycle.h
src/gromacs/utility/basedefinitions.h
src/programs/mdrun/md.cpp
src/programs/mdrun/tests/moduletest.cpp

diff --cc CMakeLists.txt
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0cdb28b88548189f02a40f075e454dfb2a0baa0a,a904a2ef52dce09ee00aa647a482c56cb1ebbd51..07f89c5114b987e435cd72fd15c1d5f28b3c122d
@@@ -405,10 -413,17 +407,11 @@@ static void pull_potential_wrapper(t_co
      enerd->term[F_COM_PULL] +=
          pull_potential(ir->ePull, ir->pull, mdatoms, &pbc,
                         cr, t, lambda[efptRESTRAINT], x, f, vir_force, &dvdl);
 -    if (bSepDVDL)
 -    {
 -        gmx_print_sepdvdl(fplog, "Com pull", enerd->term[F_COM_PULL], dvdl);
 -    }
      enerd->dvdl_lin[efptRESTRAINT] += dvdl;
+     wallcycle_stop(wcycle, ewcPULLPOT);
  }
  
 -static void pme_receive_force_ener(FILE           *fplog,
 -                                   gmx_bool        bSepDVDL,
 -                                   t_commrec      *cr,
 +static void pme_receive_force_ener(t_commrec      *cr,
                                     gmx_wallcycle_t wcycle,
                                     gmx_enerdata_t *enerd,
                                     t_forcerec     *fr)
@@@ -1513,8 -1530,12 +1516,12 @@@ void do_force_cutsVERLET(FILE *fplog, t
  
      if (inputrec->ePull == epullUMBRELLA || inputrec->ePull == epullCONST_F)
      {
 -        pull_potential_wrapper(fplog, bSepDVDL, cr, inputrec, box, x,
+         /* Since the COM pulling is always done mass-weighted, no forces are
+          * applied to vsites and this call can be done after vsite spreading.
+          */
-                                f, vir_force, mdatoms, enerd, lambda, t);
 +        pull_potential_wrapper(cr, inputrec, box, x,
+                                f, vir_force, mdatoms, enerd, lambda, t,
+                                wcycle);
      }
  
      /* Add the forces from enforced rotation potentials (if any) */
@@@ -1985,8 -2008,9 +1992,9 @@@ void do_force_cutsGROUP(FILE *fplog, t_
  
      if (inputrec->ePull == epullUMBRELLA || inputrec->ePull == epullCONST_F)
      {
 -        pull_potential_wrapper(fplog, bSepDVDL, cr, inputrec, box, x,
 +        pull_potential_wrapper(cr, inputrec, box, x,
-                                f, vir_force, mdatoms, enerd, lambda, t);
+                                f, vir_force, mdatoms, enerd, lambda, t,
+                                wcycle);
      }
  
      /* Add the forces from enforced rotation potentials (if any) */
Simple merge
Simple merge
index 97287aa708b0d218d1a6ee91d9e987e786a15ea7,19e762346c77e98eddfd8ea64a0d285b859b0662..3d90b1ae9c8aa6af93414d2510bef57a05a7a6f9
  
  #include <stdlib.h>
  
 -#include "sysstuff.h"
 -#include "princ.h"
 -#include "gromacs/fileio/futil.h"
 -#include "vec.h"
 +#include "gromacs/utility/futil.h"
 +#include "gromacs/math/vec.h"
  #include "gromacs/utility/smalloc.h"
 -#include "typedefs.h"
 -#include "types/commrec.h"
 -#include "names.h"
 -#include "gmx_fatal.h"
 -#include "macros.h"
 -#include "symtab.h"
 -#include "index.h"
 +#include "gromacs/legacyheaders/typedefs.h"
 +#include "gromacs/legacyheaders/types/commrec.h"
 +#include "gromacs/legacyheaders/names.h"
 +#include "gromacs/utility/fatalerror.h"
 +#include "gromacs/legacyheaders/macros.h"
  #include "gromacs/fileio/confio.h"
 -#include "network.h"
 -#include "pbc.h"
 +#include "gromacs/legacyheaders/network.h"
 +#include "gromacs/pbcutil/pbc.h"
  #include "pull.h"
 -#include "gmx_ga2la.h"
 +#include "gromacs/legacyheaders/gmx_ga2la.h"
  
  static void pull_set_pbcatom(t_commrec *cr, t_pull_group *pgrp,
-                              t_mdatoms *md, rvec *x,
+                              rvec *x,
                               rvec x_pbc)
  {
      int a, m;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 06601be1e4d1f9c1593bb107210f7e3b42cb5824,177913fad1212ed2c34808fe16dd744b31b516ef..1d89772d2a197883fb94864b6cec07c1390821da
@@@ -75,35 -71,8 +75,31 @@@ namespac
  class NeighborhoodSearchTestData
  {
      public:
 +        struct RefPair
 +        {
 +            RefPair(int refIndex, real distance)
 +                : refIndex(refIndex), distance(distance), bFound(false),
 +                  bExcluded(false)
 +            {
 +            }
 +
 +            bool operator<(const RefPair &other) const
 +            {
 +                return refIndex < other.refIndex;
 +            }
 +
 +            int                 refIndex;
 +            real                distance;
 +            // The variables below are state variables that are only used
 +            // during the actual testing after creating a copy of the reference
 +            // pair list, not as part of the reference data.
 +            // Simpler to have just a single structure for both purposes.
 +            bool                bFound;
 +            bool                bExcluded;
 +        };
 +
          struct TestPosition
          {
-             TestPosition() : refMinDist(0.0), refNearestPoint(-1)
-             {
-                 clear_rvec(x);
-             }
              explicit TestPosition(const rvec x)
                  : refMinDist(0.0), refNearestPoint(-1)
              {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 18a898cce5f6e919bd5e33c5f47437806db30038,0000000000000000000000000000000000000000..faa4395328c4c3eaefabbf99dc4b2a2bf2e60ac2
mode 100644,000000..100644
--- /dev/null
@@@ -1,207 -1,0 +1,210 @@@
 +/*
 + * This file is part of the GROMACS molecular simulation package.
 + *
 + * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
 + * Copyright (c) 2001-2004, The GROMACS development team.
 + * Copyright (c) 2013,2014, by the GROMACS development team, led by
 + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 + * and including many others, as listed in the AUTHORS file in the
 + * top-level source directory and at http://www.gromacs.org.
 + *
 + * GROMACS is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public License
 + * as published by the Free Software Foundation; either version 2.1
 + * of the License, or (at your option) any later version.
 + *
 + * GROMACS is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with GROMACS; if not, see
 + * http://www.gnu.org/licenses, or write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 + *
 + * If you want to redistribute modifications to GROMACS, please
 + * consider that scientific software is very special. Version
 + * control is crucial - bugs must be traceable. We will be happy to
 + * consider code for inclusion in the official distribution, but
 + * derived work must not be called official GROMACS. Details are found
 + * in the README & COPYING files - if they are missing, get the
 + * official version at http://www.gromacs.org.
 + *
 + * To help us fund GROMACS development, we humbly ask that you cite
 + * the research papers on the package. Check out http://www.gromacs.org.
 + */
 +/*! \file
 + * \brief
 + * Basic types and macros used throughout \Gromacs.
 + *
 + * \inpublicapi
 + * \ingroup module_utility
 + */
 +#ifndef GMX_UTILITY_BASEDEFINITIONS_H
 +#define GMX_UTILITY_BASEDEFINITIONS_H
 +
 +/* Information about integer data type sizes */
 +#include <limits.h>
 +#define __STDC_LIMIT_MACROS
 +#include <stdint.h>
 +#ifndef _MSC_VER
 +#define __STDC_FORMAT_MACROS
 +#include <inttypes.h>
 +#endif
 +
 +/*! \brief
 + * Boolean type for use in \Gromacs C code.
 + *
 + * There is no standard size for 'bool' in C++, so when
 + * we previously defined it to int for C code the data types
 + * (and structs) would have different size depending on your compiler,
 + * both at \Gromacs build time and when you use the library.
 + * The only way around this is to NOT assume anything about the C++ type,
 + * so we cannot use the name 'bool' in our C code anymore.
 + */
 +typedef int gmx_bool;
 +
 +#ifndef FALSE
 +/** False value for ::gmx_bool. */
 +#  define FALSE   0
 +#endif
 +#ifndef TRUE
 +/** True value for ::gmx_bool. */
 +#  define TRUE    1
 +#endif
 +/** Number of gmx_bool values. */
 +#define BOOL_NR 2
 +
 +/*! \name Fixed-width integer types
 + *
 + * These types and macros provide the equivalent of 32- and 64-bit integer
 + * types from C99 headers `stdint.h` and `inttypes.h`.  These headers are also
 + * there in C++11.  The types and macros from here should be used instead of
 + * `int32_t` etc.
 + * MSVC doesn't support these before Visual Studio 2013.
 + */
 +/*! \{ */
 +#ifdef _MSC_VER
 +typedef __int32 gmx_int32_t;
 +#define GMX_PRId32 "I32d"
 +#define GMX_SCNd32 "I32d"
 +
 +typedef __int64 gmx_int64_t;
 +#define GMX_PRId64 "I64d"
 +#define GMX_SCNd64 "I64d"
 +
 +typedef unsigned __int32 gmx_uint32_t;
 +#define GMX_PRIu32 "I32u"
 +#define GMX_SCNu32 "I32u"
 +
 +typedef unsigned __int64 gmx_uint64_t;
 +#define GMX_PRIu64 "I64u"
 +#define GMX_SCNu64 "I64u"
 +#else
 +typedef int32_t gmx_int32_t;
 +#define GMX_PRId32 PRId32
 +#define GMX_SCNd32 SCNd32
 +
 +typedef int64_t gmx_int64_t;
 +#define GMX_PRId64 PRId64
 +#define GMX_SCNd64 SCNd64
 +
 +typedef uint32_t gmx_uint32_t;
 +#define GMX_PRIu32 PRIu32
 +#define GMX_SCNu32 SCNu32
 +
 +typedef uint64_t gmx_uint64_t;
 +#define GMX_PRIu64 PRIu64
 +#define GMX_SCNu64 SCNu64
 +#endif
 +
 +#define GMX_INT32_MAX INT32_MAX
 +#define GMX_INT32_MIN INT32_MIN
 +
 +#define GMX_INT64_MAX INT64_MAX
 +#define GMX_INT64_MIN INT64_MIN
 +
 +#define GMX_UINT32_MAX UINT32_MAX
 +#define GMX_UINT32_MIN UINT32_MIN
 +
 +#define GMX_UINT64_MAX UINT64_MAX
 +#define GMX_UINT64_MIN UINT64_MIN
 +/*! \} */
 +
 +/*! \def gmx_inline
 + * \brief
 + * Keyword to use in C code instead of C99 `inline`.
 + *
 + * Some of the C compilers we support do not recognize the C99 keyword
 + * `inline`.  This macro should be used in C code and in shared C/C++ headers
 + * to indicate a function is inlined.
 + * C++ code should use plain `inline`, as that is already in C++98.
 + */
 +#if !defined __cplusplus && _MSC_VER
 +#define gmx_inline __inline
 +#else
 +/* C++ or C99 */
 +#define gmx_inline inline
 +#endif
 +
 +/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
 + * Any other compiler can be added here. */
 +/*! \brief
 + * Keyword to use in instead of C99 `restrict`.
 + *
 + * We cannot use `restrict` because it is only in C99, but not in C++.
 + * This macro should instead be used to allow easily supporting different
 + * compilers.
 + */
 +#define gmx_restrict __restrict
 +
 +/*! \def gmx_cxx_const
 + * \brief
 + * Keyword to work around C/C++ differences in possible const keyword usage.
 + *
 + * Some functions that do not modify their input parameters cannot declare
 + * those parameters as `const` and compile warning/error-free on both C and C++
 + * compilers because of differences in `const` semantics.  This macro can be
 + * used in cases where C++ allows `const`, but C does not like it, to make the
 + * same declaration work for both.
 + */
 +#ifdef __cplusplus
 +#define gmx_cxx_const const
 +#else
 +#define gmx_cxx_const
 +#endif
 +
 +/*! \def gmx_unused
 + * \brief
 + * Attribute to suppress compiler warnings about unused function parameters.
 + *
 + * This attribute suppresses compiler warnings about unused function arguments
 + * by marking them as possibly unused.  Some arguments are unused but
 + * have to be retained to preserve a function signature
 + * that must match that of another function.
 + * Some arguments are only used in *some* conditional compilation code paths
 + * (e.g. MPI).
 + */
 +#ifndef gmx_unused
 +#ifdef __GNUC__
 +/* GCC, clang, and some ICC pretending to be GCC */
 +#  define gmx_unused __attribute__ ((unused))
 +#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER)
 +/* ICC on *nix */
 +#  define gmx_unused __attribute__ ((unused))
++#elif defined(__PGI)
++/* Portland group compilers */
++#  define gmx_unused __attribute__ ((unused))
 +#elif defined _MSC_VER
 +/* MSVC */
 +#  define gmx_unused /*@unused@*/
 +#elif defined(__xlC__)
 +/* IBM */
 +#  define gmx_unused __attribute__ ((unused))
 +#else
 +#  define gmx_unused
 +#endif
 +#endif
 +
 +#endif
index 3bf621fe6dab644c5900421e39a218ca15fa99c7,2b320246b588bfd34c87f02885847096fa53499f..259484cc18018aca3a2c67394350281c6a0391ed
@@@ -1148,8 -1161,10 +1149,9 @@@ double do_md(FILE *fplog, t_commrec *cr
                      }
                  }
  
 -                bOK = TRUE;
                  if (!bRerunMD || rerun_fr.bV || bForceUpdate)     /* Why is rerun_fr.bV here?  Unclear. */
                  {
+                     wallcycle_stop(wcycle, ewcUPDATE);
                      update_constraints(fplog, step, NULL, ir, ekind, mdatoms,
                                         state, fr->bMolPBC, graph, f,
                                         &top->idef, shake_vir,