From: Roland Schulz Date: Fri, 7 Mar 2014 00:28:39 +0000 (-0500) Subject: Fix dependencies on config.h for typedefs.h X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=5e945648a83fe7fd9bfa0a50967732ece91c4173;p=alexxy%2Fgromacs.git Fix dependencies on config.h for typedefs.h The include in simple.h hid other dependencies and was only used for gmx_inline and gmx_restrict. Defining those in just one place simplifies it. Also fix missing includes in public headers. All public headers should be able to be compiled by themselfes and shouldn't rely on other headers aready being included. Also fixes that math module headers were installed to maths. thread-mpi headers and commrec.h are not installed anymore. The installed headers have no dependency on GMX_LIB_MPI and GMX_THREAD_MPI anymore. Change-Id: Ie1f26913739d3e42d653a51fa2c2d71e6ea3ef7a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fcbfac813..df522432c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -450,7 +450,6 @@ tmpi_enable_cxx() if(GMX_THREAD_MPI) # enable MPI functions tmpi_enable() - set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_THREAD_MPI") set(GMX_MPI 1) set(MPI_IN_PLACE_EXISTS 1) endif() @@ -582,12 +581,6 @@ gmx_test_large_files(GMX_LARGEFILES) include(gmxTestSignal) gmx_test_sigusr1(HAVE_SIGUSR1) -include(gmxTestInline) -gmx_test_inline(INLINE_KEYWORD) - -include(gmxTestRestrict) -gmx_test_restrict(RESTRICT_KEYWORD) - include(gmxTestPipes) gmx_test_pipes(HAVE_PIPES) diff --git a/cmake/gmxTestInline.cmake b/cmake/gmxTestInline.cmake deleted file mode 100644 index c9e8125981..0000000000 --- a/cmake/gmxTestInline.cmake +++ /dev/null @@ -1,66 +0,0 @@ -# -# This file is part of the GROMACS molecular simulation package. -# -# Copyright (c) 2009,2012,2014, by the GROMACS development team, led by -# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, -# and including many others, as listed in the AUTHORS file in the -# top-level source directory and at http://www.gromacs.org. -# -# GROMACS is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public License -# as published by the Free Software Foundation; either version 2.1 -# of the License, or (at your option) any later version. -# -# GROMACS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with GROMACS; if not, see -# http://www.gnu.org/licenses, or write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# If you want to redistribute modifications to GROMACS, please -# consider that scientific software is very special. Version -# control is crucial - bugs must be traceable. We will be happy to -# consider code for inclusion in the official distribution, but -# derived work must not be called official GROMACS. Details are found -# in the README & COPYING files - if they are missing, get the -# official version at http://www.gromacs.org. -# -# To help us fund GROMACS development, we humbly ask that you cite -# the research papers on the package. Check out http://www.gromacs.org. - -# - Define macro to check inline keyword -# -# GMX_TEST_INLINE(VARIABLE) -# -# VARIABLE will be set to the keyword -# -# Remember to have a cmakedefine for it too... - -MACRO(GMX_TEST_INLINE VARIABLE) - IF(NOT DEFINED TEST_${VARIABLE}) - - MESSAGE(STATUS "Checking for inline keyword") - - FOREACH(KEYWORD "__inline__" "__inline" "inline") - IF(NOT TEST_${VARIABLE}) - TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" - "${CMAKE_SOURCE_DIR}/cmake/TestInline.c" - COMPILE_DEFINITIONS "-DTESTINLINEDEF=${KEYWORD}" ) - SET(LAST_INLINE_KEYWORD ${KEYWORD}) - ENDIF() - ENDFOREACH(KEYWORD) - - IF(TEST_${VARIABLE}) - SET(${VARIABLE} ${LAST_INLINE_KEYWORD} CACHE INTERNAL "Inline keyword" FORCE) - MESSAGE(STATUS "Checking for inline keyword - ${LAST_INLINE_KEYWORD}") - ELSE() - SET(${VARIABLE} " " CACHE INTERNAL "Inline keyword" FORCE) - MESSAGE(STATUS "Checking for inline keyword - not found") - ENDIF() - - ENDIF() -ENDMACRO(GMX_TEST_INLINE VARIABLE) diff --git a/cmake/gmxTestRestrict.cmake b/cmake/gmxTestRestrict.cmake deleted file mode 100644 index 391e8e4882..0000000000 --- a/cmake/gmxTestRestrict.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# -# This file is part of the GROMACS molecular simulation package. -# -# Copyright (c) 2010,2012,2014, by the GROMACS development team, led by -# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, -# and including many others, as listed in the AUTHORS file in the -# top-level source directory and at http://www.gromacs.org. -# -# GROMACS is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public License -# as published by the Free Software Foundation; either version 2.1 -# of the License, or (at your option) any later version. -# -# GROMACS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with GROMACS; if not, see -# http://www.gnu.org/licenses, or write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# If you want to redistribute modifications to GROMACS, please -# consider that scientific software is very special. Version -# control is crucial - bugs must be traceable. We will be happy to -# consider code for inclusion in the official distribution, but -# derived work must not be called official GROMACS. Details are found -# in the README & COPYING files - if they are missing, get the -# official version at http://www.gromacs.org. -# -# To help us fund GROMACS development, we humbly ask that you cite -# the research papers on the package. Check out http://www.gromacs.org. - -# - Define macro to check restrict keyword -# -# GMX_TEST_RESTRICT(VARIABLE) -# -# VARIABLE will be set to the keyword -# -# Remember to have a cmakedefine for it too... - -MACRO(GMX_TEST_RESTRICT VARIABLE) - IF(NOT DEFINED TEST_${VARIABLE}) - - MESSAGE(STATUS "Checking for restrict keyword") - -# Start with __restrict__, since that is the C++ default keyword. - FOREACH(KEYWORD "__restrict__" "__restrict" "restrict") - IF(NOT TEST_${VARIABLE}) - TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" - "${CMAKE_SOURCE_DIR}/cmake/TestRestrict.c" - COMPILE_DEFINITIONS "-DTESTRESTRICTDEF=${KEYWORD}" ) - SET(LAST_RESTRICT_KEYWORD ${KEYWORD}) - ENDIF() - ENDFOREACH(KEYWORD) - - IF(TEST_${VARIABLE}) - SET(${VARIABLE} ${LAST_RESTRICT_KEYWORD} CACHE INTERNAL "Restrict keyword" FORCE) - MESSAGE(STATUS "Checking for restrict keyword - ${LAST_RESTRICT_KEYWORD}") - ELSE() - SET(${VARIABLE} " " CACHE INTERNAL "Restrict keyword" FORCE) - MESSAGE(STATUS "Checking for restrict keyword - not found") - ENDIF() - - ENDIF() -ENDMACRO(GMX_TEST_RESTRICT VARIABLE) diff --git a/src/config.h.cmakein b/src/config.h.cmakein index 1b03b16747..4aefa453f8 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -340,21 +340,6 @@ /* Some systems requires this to be set to 64 for large file support */ #cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@ -/* Define to __inline__ or __inline if that is what the C compiler - calls it, or to nothing if inline is not supported under any name. - Please do NOT remove the gmx_inline keyword from here. The classical - C++ inline keyword is merely a recommendation to the compiler, and - many compilers support stronger alternatives (e.g. __forceinline) - that we might want to use. */ -#define gmx_inline ${INLINE_KEYWORD} - -/* Define to __restrict__ or __restrict if that is what the C compiler - calls it, unless we are on C99 when it is simply called restrict. - Since restrict is a reserved key word in C99 we are not allowed to - redefine the word itself, so call this gmx_restrict to avoid having - to identify the language standard level. If it is not supported, it - is still defined to an empty string here. */ -#define gmx_restrict ${RESTRICT_KEYWORD} /* Build special-purpose mdrun library */ #cmakedefine GMX_FAHCORE diff --git a/src/gromacs/fft/fft5d.h b/src/gromacs/fft/fft5d.h index a577efc175..feab8329fa 100644 --- a/src/gromacs/fft/fft5d.h +++ b/src/gromacs/fft/fft5d.h @@ -40,10 +40,6 @@ #include #endif -#ifdef __cplusplus -extern "C" { -#endif - #ifdef NOGMX /*#define GMX_MPI*/ /*#define GMX_FFT_FFTW3*/ @@ -70,12 +66,18 @@ double MPI_Wtime(); #endif #ifdef NOGMX +#ifdef __cplusplus +extern "C" { +#endif struct fft5d_time_t { double fft, local, mpi1, mpi2; }; typedef struct fft5d_time_t *fft5d_time; #else #include "gromacs/timing/wallcycle.h" +#ifdef __cplusplus +extern "C" { +#endif typedef gmx_wallcycle_t fft5d_time; #endif diff --git a/src/gromacs/fileio/filenm.h b/src/gromacs/fileio/filenm.h index 74274628cf..12933f6315 100644 --- a/src/gromacs/fileio/filenm.h +++ b/src/gromacs/fileio/filenm.h @@ -38,8 +38,7 @@ #ifndef GMX_FILEIO_FILENM_H #define GMX_FILEIO_FILENM_H -#include "../legacyheaders/types/simple.h" -#include "../legacyheaders/types/commrec.h" +#include "../legacyheaders/typedefs.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/fileio/futil.cpp b/src/gromacs/fileio/futil.cpp index 2c54809dcb..28b5af6d29 100644 --- a/src/gromacs/fileio/futil.cpp +++ b/src/gromacs/fileio/futil.cpp @@ -66,6 +66,7 @@ #endif #include "gromacs/legacyheaders/gmx_fatal.h" +#include "gromacs/legacyheaders/types/commrec.h" #include "gromacs/legacyheaders/network.h" #include "gromacs/legacyheaders/smalloc.h" #include "gromacs/legacyheaders/string2.h" diff --git a/src/gromacs/fileio/futil.h b/src/gromacs/fileio/futil.h index bb76b03ff4..ddaaef1b4b 100644 --- a/src/gromacs/fileio/futil.h +++ b/src/gromacs/fileio/futil.h @@ -40,7 +40,6 @@ #include #include "../legacyheaders/typedefs.h" -#include "../legacyheaders/types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/fileio/mdoutf.c b/src/gromacs/fileio/mdoutf.c index 1fda720433..d140e1dc6a 100644 --- a/src/gromacs/fileio/mdoutf.c +++ b/src/gromacs/fileio/mdoutf.c @@ -37,6 +37,7 @@ #include "gromacs/legacyheaders/xvgr.h" #include "gromacs/legacyheaders/mdrun.h" #include "gromacs/legacyheaders/smalloc.h" +#include "gromacs/legacyheaders/types/commrec.h" #include "gromacs/legacyheaders/mvdata.h" #include "gromacs/legacyheaders/domdec.h" #include "trnio.h" diff --git a/src/gromacs/fileio/trajectory_writing.h b/src/gromacs/fileio/trajectory_writing.h index b4355bad13..65e8e067ea 100644 --- a/src/gromacs/fileio/trajectory_writing.h +++ b/src/gromacs/fileio/trajectory_writing.h @@ -41,8 +41,7 @@ #include #include "filenm.h" #include "mdoutf.h" -#include "../legacyheaders/types/simple.h" -#include "../legacyheaders/types/commrec.h" +#include "../legacyheaders/typedefs.h" #include "../legacyheaders/mdebin.h" /*! \brief Wrapper routine for writing trajectories during mdrun diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index 16d6f6740a..eb165a6311 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -36,6 +36,7 @@ #include "gromacs/commandline/pargs.h" #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "vec.h" #include "copyrite.h" diff --git a/src/gromacs/gmxana/gmx_tune_pme.c b/src/gromacs/gmxana/gmx_tune_pme.c index eeed729591..ac6a6e779e 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.c +++ b/src/gromacs/gmxana/gmx_tune_pme.c @@ -46,6 +46,7 @@ #include "gromacs/commandline/pargs.h" #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "vec.h" #include "copyrite.h" diff --git a/src/gromacs/gmxlib/checkpoint.c b/src/gromacs/gmxlib/checkpoint.c index 438b8c30af..1cf6248291 100644 --- a/src/gromacs/gmxlib/checkpoint.c +++ b/src/gromacs/gmxlib/checkpoint.c @@ -61,6 +61,7 @@ #include "copyrite.h" #include "names.h" #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "txtdump.h" #include "vec.h" diff --git a/src/gromacs/gmxlib/disre.c b/src/gromacs/gmxlib/disre.c index e390656436..b792c2240a 100644 --- a/src/gromacs/gmxlib/disre.c +++ b/src/gromacs/gmxlib/disre.c @@ -41,6 +41,7 @@ #include #include "typedefs.h" +#include "types/commrec.h" #include "sysstuff.h" #include "smalloc.h" #include "macros.h" diff --git a/src/gromacs/gmxlib/ewald_util.c b/src/gromacs/gmxlib/ewald_util.c index 99e57148cc..8b81132308 100644 --- a/src/gromacs/gmxlib/ewald_util.c +++ b/src/gromacs/gmxlib/ewald_util.c @@ -42,6 +42,7 @@ #include #include "gromacs/math/utilities.h" #include "typedefs.h" +#include "types/commrec.h" #include "vec.h" #include "coulomb.h" #include "smalloc.h" diff --git a/src/gromacs/gmxlib/gmx_fatal.c b/src/gromacs/gmxlib/gmx_fatal.c index 1481bde2ee..86ea380790 100644 --- a/src/gromacs/gmxlib/gmx_fatal.c +++ b/src/gromacs/gmxlib/gmx_fatal.c @@ -44,6 +44,7 @@ #include #include "main.h" +#include "types/commrec.h" #include "network.h" #include "gmx_fatal.h" #include "copyrite.h" diff --git a/src/gromacs/gmxlib/main.cpp b/src/gromacs/gmxlib/main.cpp index f28c222dc9..4b4d75855e 100644 --- a/src/gromacs/gmxlib/main.cpp +++ b/src/gromacs/gmxlib/main.cpp @@ -49,6 +49,7 @@ #endif #include "smalloc.h" +#include "types/commrec.h" #include "gmx_fatal.h" #include "network.h" #include "main.h" diff --git a/src/gromacs/gmxlib/mvdata.c b/src/gromacs/gmxlib/mvdata.c index 1e491b25aa..299d2729e6 100644 --- a/src/gromacs/gmxlib/mvdata.c +++ b/src/gromacs/gmxlib/mvdata.c @@ -44,6 +44,7 @@ #include "typedefs.h" #include "main.h" #include "mvdata.h" +#include "types/commrec.h" #include "network.h" #include "smalloc.h" #include "gmx_fatal.h" diff --git a/src/gromacs/gmxlib/network.c b/src/gromacs/gmxlib/network.c index c47bbbceb9..f850de4e92 100644 --- a/src/gromacs/gmxlib/network.c +++ b/src/gromacs/gmxlib/network.c @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -42,6 +42,7 @@ #include "gmx_fatal.h" #include "main.h" #include "smalloc.h" +#include "types/commrec.h" #include "network.h" #include "copyrite.h" #include @@ -774,7 +775,7 @@ void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gm #ifdef GMX_MPI -void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm) +static void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm) { #if defined(MPI_IN_PLACE_EXISTS) MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_DOUBLE, MPI_SUM, mpi_comm); @@ -797,7 +798,7 @@ void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm) #endif #ifdef GMX_MPI -void gmx_sumf_comm(int nr, float r[], MPI_Comm mpi_comm) +static void gmx_sumf_comm(int nr, float r[], MPI_Comm mpi_comm) { #if defined(MPI_IN_PLACE_EXISTS) MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_FLOAT, MPI_SUM, mpi_comm); diff --git a/src/gromacs/gmxlib/orires.c b/src/gromacs/gmxlib/orires.c index 44a8361de0..a25411ba9d 100644 --- a/src/gromacs/gmxlib/orires.c +++ b/src/gromacs/gmxlib/orires.c @@ -42,6 +42,7 @@ #include "smalloc.h" #include "vec.h" #include "nrjac.h" +#include "types/commrec.h" #include "network.h" #include "orires.h" #include "do_fit.h" diff --git a/src/gromacs/gmxlib/pbc.c b/src/gromacs/gmxlib/pbc.c index c2ceaef80d..514c680a73 100644 --- a/src/gromacs/gmxlib/pbc.c +++ b/src/gromacs/gmxlib/pbc.c @@ -43,6 +43,7 @@ #include "sysstuff.h" #include "typedefs.h" +#include "types/commrec.h" #include "vec.h" #include "gromacs/math/utilities.h" #include "main.h" diff --git a/src/gromacs/gmxlib/txtdump.c b/src/gromacs/gmxlib/txtdump.c index a4460a0922..90ff108350 100644 --- a/src/gromacs/gmxlib/txtdump.c +++ b/src/gromacs/gmxlib/txtdump.c @@ -43,6 +43,7 @@ #include #include "smalloc.h" #include "typedefs.h" +#include "types/commrec.h" #include "names.h" #include "txtdump.h" #include "string2.h" diff --git a/src/gromacs/gmxpreprocess/addconf.c b/src/gromacs/gmxpreprocess/addconf.c index e9ea538fd9..68b80f19c7 100644 --- a/src/gromacs/gmxpreprocess/addconf.c +++ b/src/gromacs/gmxpreprocess/addconf.c @@ -45,6 +45,7 @@ #include "vec.h" #include "macros.h" #include "smalloc.h" +#include "types/commrec.h" #include "force.h" #include "names.h" #include "nsgrid.h" diff --git a/src/gromacs/legacyheaders/CMakeLists.txt b/src/gromacs/legacyheaders/CMakeLists.txt index 944f537cbc..586797fab9 100644 --- a/src/gromacs/legacyheaders/CMakeLists.txt +++ b/src/gromacs/legacyheaders/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2010,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, # and including many others, as listed in the AUTHORS file in the # top-level source directory and at http://www.gromacs.org. @@ -33,11 +33,12 @@ # the research papers on the package. Check out http://www.gromacs.org. # includes: Nothing to build, just installation -file(GLOB ROOT_LEGACY_HEADERS *.h) -file(GLOB THREAD_MPI_LEGACY_HEADERS thread_mpi/*.h) -file(GLOB THREAD_MPI_ATOMIC_LEGACY_HEADERS thread_mpi/atomic/*.h) -file(GLOB TYPES_LEGACY_HEADERS types/*.h) +file(GLOB ROOT_LEGACY_HEADERS *.h) +file(GLOB ROOT_LEGACY_HEADERS_PRIVATE thread_mpi.h tmpi.h gmx_hash.h + gmx_ga2la.h gpu_utils.h pmalloc_cuda.h nbnxn_cuda_data_mgmt.h) +file(GLOB TYPES_LEGACY_HEADERS types/*.h) +file(GLOB TYPES_LEGACY_HEADERS_PRIVATE types/commrec.h) +list(REMOVE_ITEM ROOT_LEGACY_HEADERS ${ROOT_LEGACY_HEADERS_PRIVATE}) +list(REMOVE_ITEM TYPES_LEGACY_HEADERS ${TYPES_LEGACY_HEADERS_PRIVATE}) gmx_install_headers(legacyheaders ${ROOT_LEGACY_HEADERS}) -gmx_install_headers(legacyheaders/thread_mpi ${THREAD_MPI_LEGACY_HEADERS}) -gmx_install_headers(legacyheaders/thread_mpi/atomic ${THREAD_MPI_ATOMIC_LEGACY_HEADERS}) gmx_install_headers(legacyheaders/types ${TYPES_LEGACY_HEADERS}) diff --git a/src/gromacs/legacyheaders/constr.h b/src/gromacs/legacyheaders/constr.h index 89ae893c43..69f0a0a6fb 100644 --- a/src/gromacs/legacyheaders/constr.h +++ b/src/gromacs/legacyheaders/constr.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,7 +38,6 @@ #ifndef _constr_h #define _constr_h #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/coulomb.h b/src/gromacs/legacyheaders/coulomb.h index 95b928555f..7d086ddb42 100644 --- a/src/gromacs/legacyheaders/coulomb.h +++ b/src/gromacs/legacyheaders/coulomb.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,7 +40,6 @@ #include #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/domdec.h b/src/gromacs/legacyheaders/domdec.h index 32b7cf4bce..6a0fb7c7ca 100644 --- a/src/gromacs/legacyheaders/domdec.h +++ b/src/gromacs/legacyheaders/domdec.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,7 +37,6 @@ #define _domdec_h #include "typedefs.h" -#include "types/commrec.h" #include "vsite.h" #include "genborn.h" diff --git a/src/gromacs/legacyheaders/domdec_network.h b/src/gromacs/legacyheaders/domdec_network.h index e7504346e1..84e6b2e556 100644 --- a/src/gromacs/legacyheaders/domdec_network.h +++ b/src/gromacs/legacyheaders/domdec_network.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2008,2009,2010,2012, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,7 +37,6 @@ #define _domdec_network_h #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/genborn.h b/src/gromacs/legacyheaders/genborn.h index 12d723b060..99e2d51513 100644 --- a/src/gromacs/legacyheaders/genborn.h +++ b/src/gromacs/legacyheaders/genborn.h @@ -40,7 +40,6 @@ #define _genborn_h #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_detect_hardware.h b/src/gromacs/legacyheaders/gmx_detect_hardware.h index d45a2b53b8..0e63803138 100644 --- a/src/gromacs/legacyheaders/gmx_detect_hardware.h +++ b/src/gromacs/legacyheaders/gmx_detect_hardware.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,7 +36,7 @@ #ifndef GMX_HARDWARE_DETECT_H #define GMX_HARDWARE_DETECT_H -#include "types/hw_info.h" +#include "typedefs.h" #ifdef __cplusplus extern "C" { @@ -48,7 +48,6 @@ extern "C" { /* the init and consistency functions depend on commrec that may not be consistent in cuda because MPI types don't exist there. */ #ifndef __CUDACC__ -#include "types/commrec.h" /* return a pointer to a global hwinfo structure. */ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr, gmx_bool bDetectGPUs); diff --git a/src/gromacs/legacyheaders/gmx_fatal_collective.h b/src/gromacs/legacyheaders/gmx_fatal_collective.h index af5599698b..c7e59575a5 100644 --- a/src/gromacs/legacyheaders/gmx_fatal_collective.h +++ b/src/gromacs/legacyheaders/gmx_fatal_collective.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2012, The GROMACS development team. - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,8 +38,7 @@ #ifndef _fatal_collective_h #define _fatal_collective_h -#include "types/simple.h" -#include "types/commrec.h" +#include "typedefs.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_ga2la.h b/src/gromacs/legacyheaders/gmx_ga2la.h index cc816208dc..c6f9ca34de 100644 --- a/src/gromacs/legacyheaders/gmx_ga2la.h +++ b/src/gromacs/legacyheaders/gmx_ga2la.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, by the GROMACS development team, led by + * Copyright (c) 2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,6 +38,7 @@ #define _gmx_ga2la_h #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/gmx_hash.h b/src/gromacs/legacyheaders/gmx_hash.h index 117e8f73ca..0be9117276 100644 --- a/src/gromacs/legacyheaders/gmx_hash.h +++ b/src/gromacs/legacyheaders/gmx_hash.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -37,6 +37,7 @@ #include "typedefs.h" #include "smalloc.h" +#include "gmx_fatal.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_omp_nthreads.h b/src/gromacs/legacyheaders/gmx_omp_nthreads.h index a96e932d92..f4010010db 100644 --- a/src/gromacs/legacyheaders/gmx_omp_nthreads.h +++ b/src/gromacs/legacyheaders/gmx_omp_nthreads.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,7 +36,8 @@ #ifndef GMX_OMP_NTHREADS #define GMX_OMP_NTHREADS -#include "types/commrec.h" +#include +#include "typedefs.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/gmx_thread_affinity.h b/src/gromacs/legacyheaders/gmx_thread_affinity.h index 8de038d4ef..2ee5cfd4e3 100644 --- a/src/gromacs/legacyheaders/gmx_thread_affinity.h +++ b/src/gromacs/legacyheaders/gmx_thread_affinity.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -34,7 +34,6 @@ */ #ifndef GMX_THREAD_AFFINITY_H_ #define GMX_THREAD_AFFINITY_H_ -#include "types/commrec.h" #include "typedefs.h" #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/gpu_utils.h b/src/gromacs/legacyheaders/gpu_utils.h index a993a450a0..e296073049 100644 --- a/src/gromacs/legacyheaders/gpu_utils.h +++ b/src/gromacs/legacyheaders/gpu_utils.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2010, The GROMACS development team. - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,6 +38,10 @@ #ifndef _GPU_UTILS_H_ #define _GPU_UTILS_H_ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "types/simple.h" #include "types/hw_info.h" diff --git a/src/gromacs/legacyheaders/main.h b/src/gromacs/legacyheaders/main.h index 81011e23f9..58356f6a6a 100644 --- a/src/gromacs/legacyheaders/main.h +++ b/src/gromacs/legacyheaders/main.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,6 +40,7 @@ #include +#include "typedefs.h" #include "network.h" #include "../fileio/filenm.h" diff --git a/src/gromacs/legacyheaders/md_logging.h b/src/gromacs/legacyheaders/md_logging.h index 700a97f0ad..9a074b381f 100644 --- a/src/gromacs/legacyheaders/md_logging.h +++ b/src/gromacs/legacyheaders/md_logging.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,7 +38,8 @@ #ifndef _md_logging_h #define _md_logging_h -#include "types/commrec.h" +#include +#include "typedefs.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/mdrun.h b/src/gromacs/legacyheaders/mdrun.h index 5ac463ef8a..c1a16210d5 100644 --- a/src/gromacs/legacyheaders/mdrun.h +++ b/src/gromacs/legacyheaders/mdrun.h @@ -53,8 +53,6 @@ #include "types/membedt.h" #include "types/globsig.h" -#include "thread_mpi/threads.h" - #ifdef __cplusplus extern "C" { #endif @@ -81,23 +79,6 @@ enum { ddnoSEL, ddnoINTERLEAVE, ddnoPP_PME, ddnoCARTESIAN, ddnoNR }; -/* Variables for temporary use with the deform option, - * used in runner.c and md.c. - * (These variables should be stored in the tpx file.) - */ -extern gmx_int64_t deform_init_init_step_tpx; -extern matrix deform_init_box_tpx; -extern tMPI_Thread_mutex_t deform_init_box_mutex; - -#ifdef GMX_THREAD_MPI -/* The minimum number of atoms per tMPI thread. With fewer atoms than this, - * the number of threads will get lowered. - */ -#define MIN_ATOMS_PER_MPI_THREAD 90 -#define MIN_ATOMS_PER_GPU 900 -#endif - - typedef double gmx_integrator_t (FILE *log, t_commrec *cr, int nfile, const t_filenm fnm[], const output_env_t oenv, gmx_bool bVerbose, diff --git a/src/gromacs/legacyheaders/mvdata.h b/src/gromacs/legacyheaders/mvdata.h index ec19f38289..083e4fc6bc 100644 --- a/src/gromacs/legacyheaders/mvdata.h +++ b/src/gromacs/legacyheaders/mvdata.h @@ -39,7 +39,6 @@ #define _mvdata_h #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h b/src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h index 48ede0da8e..62cdfe6cea 100644 --- a/src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h +++ b/src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,6 +40,7 @@ #include "types/interaction_const.h" #include "types/nbnxn_cuda_types_ext.h" #include "types/hw_info.h" +#include "types/nb_verlet.h" #ifdef GMX_GPU #define FUNC_TERM ; diff --git a/src/gromacs/legacyheaders/network.h b/src/gromacs/legacyheaders/network.h index 4c4d86f2d7..8d4d4f17a3 100644 --- a/src/gromacs/legacyheaders/network.h +++ b/src/gromacs/legacyheaders/network.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,7 +46,6 @@ #include #include "types/simple.h" -#include "types/commrec.h" #include "typedefs.h" #include "main.h" #include "gmx_fatal.h" @@ -120,12 +119,6 @@ void gmx_sumf(int nr, float r[], const t_commrec *cr); void gmx_sumd(int nr, double r[], const t_commrec *cr); /* Calculate the global sum of an array of doubles */ -void gmx_sumf_comm(int nr, float r[], MPI_Comm mpi_comm); -/* Calculate the global sum of an array of floats */ - -void gmx_sumd_comm(int nr, double r[], MPI_Comm mpi_comm); -/* Calculate the global sum of an array of doubles */ - void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms); /* Calculate the sum over the simulations of an array of ints */ @@ -142,11 +135,9 @@ void gmx_abort(int nodeid, int nnodes, int errorno); /* Abort the parallel run */ #ifdef GMX_DOUBLE -#define gmx_sum_comm gmx_sumd_comm #define gmx_sum gmx_sumd #define gmx_sum_sim gmx_sumd_sim #else -#define gmx_sum_comm gmx_sumf_comm #define gmx_sum gmx_sumf #define gmx_sum_sim gmx_sumf_sim #endif diff --git a/src/gromacs/legacyheaders/nrnb.h b/src/gromacs/legacyheaders/nrnb.h index 642daa26b7..464a57b4ea 100644 --- a/src/gromacs/legacyheaders/nrnb.h +++ b/src/gromacs/legacyheaders/nrnb.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -39,7 +39,6 @@ #define _nrnb_h #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/pbc.h b/src/gromacs/legacyheaders/pbc.h index 6efaf9adc1..be7e51fa9e 100644 --- a/src/gromacs/legacyheaders/pbc.h +++ b/src/gromacs/legacyheaders/pbc.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,7 +40,6 @@ #include "sysstuff.h" #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/pmalloc_cuda.h b/src/gromacs/legacyheaders/pmalloc_cuda.h index b35a56c559..d00179a4ad 100644 --- a/src/gromacs/legacyheaders/pmalloc_cuda.h +++ b/src/gromacs/legacyheaders/pmalloc_cuda.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,6 +36,11 @@ #ifndef PMALLOC_CUDA_H #define PMALLOC_CUDA_H +#ifdef HAVE_CONFIG_H +#include +#endif + +#include #include "types/simple.h" #ifdef GMX_GPU diff --git a/src/gromacs/legacyheaders/tables.h b/src/gromacs/legacyheaders/tables.h index bda733b34e..e15f3c71f6 100644 --- a/src/gromacs/legacyheaders/tables.h +++ b/src/gromacs/legacyheaders/tables.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -35,7 +35,7 @@ #ifndef _tables_h #define _tables_h - +#include "types/simple.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/typedefs.h b/src/gromacs/legacyheaders/typedefs.h index 17663d2fb2..eb0b30b563 100644 --- a/src/gromacs/legacyheaders/typedefs.h +++ b/src/gromacs/legacyheaders/typedefs.h @@ -200,6 +200,13 @@ t_atoms *mtop2atoms(gmx_mtop_t *mtop); real max_cutoff(real cutoff1, real cutoff2); /* Returns the maximum of the cut-off's, taking into account that 0=inf. */ +/* Following are forward declarations for structures in commrec.h */ +typedef struct t_commrec t_commrec; +typedef struct gmx_domdec_t gmx_domdec_t; +typedef struct gmx_multisim_t gmx_multisim_t; +typedef struct gmx_domdec_zones_t gmx_domdec_zones_t; +typedef struct gmx_ddbox_t gmx_ddbox_t; + #ifdef __cplusplus } #endif diff --git a/src/gromacs/legacyheaders/types/commrec.h b/src/gromacs/legacyheaders/types/commrec.h index 86d105fa97..eaad7b4ead 100644 --- a/src/gromacs/legacyheaders/types/commrec.h +++ b/src/gromacs/legacyheaders/types/commrec.h @@ -38,6 +38,7 @@ #define _commrec_h #include "../../utility/gmxmpi.h" +#include "../typedefs.h" #include "idef.h" #ifdef __cplusplus @@ -67,7 +68,7 @@ typedef struct { rvec bb_x1; /* Zone bounding box upper corner in Cartesian coords */ } gmx_domdec_zone_size_t; -typedef struct { +struct gmx_domdec_zones_t { /* The number of zones including the home zone */ int n; /* The shift of the zones with respect to the home zone */ @@ -82,7 +83,7 @@ typedef struct { gmx_domdec_zone_size_t size[DD_MAXZONE]; /* The cg density of the home zone */ real dens_zone0; -} gmx_domdec_zones_t; +}; typedef struct gmx_ga2la *gmx_ga2la_t; @@ -98,7 +99,7 @@ typedef struct gmx_domdec_comm *gmx_domdec_comm_p_t; typedef struct gmx_pme_comm_n_box *gmx_pme_comm_n_box_p_t; -typedef struct { +struct gmx_ddbox_t { int npbcdim; int nboundeddim; rvec box0; @@ -110,7 +111,7 @@ typedef struct { rvec v[DIM][DIM]; /* Normal vectors for the cells walls */ rvec normal[DIM]; -} gmx_ddbox_t; +}; typedef struct { @@ -130,7 +131,7 @@ typedef struct { } mpi_in_place_buf_t; -typedef struct { +struct gmx_domdec_t { /* The DD particle-particle nodes only */ /* The communication setup within the communicator all * defined in dd->comm in domdec.c @@ -222,9 +223,9 @@ typedef struct { int pme_recv_f_alloc; rvec *pme_recv_f_buf; -} gmx_domdec_t; +}; -typedef struct { +struct gmx_multisim_t { int nsim; int sim; MPI_Group mpi_group_masters; @@ -232,7 +233,7 @@ typedef struct { /* these buffers are used as destination buffers if MPI_IN_PLACE isn't supported.*/ mpi_in_place_buf_t *mpb; -} gmx_multisim_t; +}; #define DUTY_PP (1<<0) #define DUTY_PME (1<<1) @@ -245,7 +246,7 @@ typedef struct { } gmx_nodecomm_t; -typedef struct { +struct t_commrec { /* The nodeids in one sim are numbered sequentially from 0. * All communication within some simulation should happen * in mpi_comm_mysim, or its subset mpi_comm_mygroup. @@ -278,7 +279,7 @@ typedef struct { /* these buffers are used as destination buffers if MPI_IN_PLACE isn't supported.*/ mpi_in_place_buf_t *mpb; -} t_commrec; +}; #define MASTERNODE(cr) (((cr)->nodeid == 0) || !PAR(cr)) /* #define MASTERTHREAD(cr) ((cr)->threadid == 0) */ diff --git a/src/gromacs/legacyheaders/types/inputrec.h b/src/gromacs/legacyheaders/types/inputrec.h index af720bbbd8..54a2afd7c5 100644 --- a/src/gromacs/legacyheaders/types/inputrec.h +++ b/src/gromacs/legacyheaders/types/inputrec.h @@ -41,7 +41,7 @@ #include "simple.h" #include "enums.h" #include "../sysstuff.h" -#include "gromacs/swap/enums.h" +#include "../../swap/enums.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/types/nbnxn_pairlist.h b/src/gromacs/legacyheaders/types/nbnxn_pairlist.h index 0748804c37..dec56d38f1 100644 --- a/src/gromacs/legacyheaders/types/nbnxn_pairlist.h +++ b/src/gromacs/legacyheaders/types/nbnxn_pairlist.h @@ -36,13 +36,8 @@ #ifndef _nbnxn_pairlist_h #define _nbnxn_pairlist_h -#ifdef HAVE_CONFIG_H -#include -#endif #include "nblist.h" -#include "../thread_mpi/atomic.h" - #ifdef __cplusplus extern "C" { #endif @@ -80,10 +75,8 @@ typedef void nbnxn_free_t (void *ptr); typedef struct { int cj; /* The j-cluster */ unsigned int excl; /* The exclusion (interaction) bits */ -#ifdef GMX_SIMD_IBM_QPX /* Indices into the arrays of SIMD interaction masks. */ char interaction_mask_indices[4]; -#endif } nbnxn_cj_t; /* In nbnxn_ci_t the integer shift contains the shift in the lower 7 bits. @@ -229,6 +222,9 @@ enum { ljcrGEOM, ljcrLB, ljcrNONE, ljcrNR }; +/* TODO: Remove need for forward declare */ +struct tMPI_Atomic; + typedef struct { nbnxn_alloc_t *alloc; nbnxn_free_t *free; @@ -266,16 +262,14 @@ typedef struct { */ unsigned int *simd_exclusion_filter1; unsigned int *simd_exclusion_filter2; -#ifdef GMX_SIMD_IBM_QPX real *simd_interaction_array; /* Array of masks needed for exclusions on QPX */ -#endif int nout; /* The number of force arrays */ nbnxn_atomdata_output_t *out; /* Output data structures */ int nalloc; /* Allocation size of all arrays (for x/f *x/fstride) */ gmx_bool bUseBufferFlags; /* Use the flags or operate on all atoms */ nbnxn_buffer_flags_t buffer_flags; /* Flags for buffer zeroing+reduc. */ gmx_bool bUseTreeReduce; /* Use tree for force reduction */ - tMPI_Atomic_t *syncStep; /* Synchronization step for tree reduce */ + struct tMPI_Atomic *syncStep; /* Synchronization step for tree reduce */ } nbnxn_atomdata_t; #ifdef __cplusplus diff --git a/src/gromacs/legacyheaders/types/simple.h b/src/gromacs/legacyheaders/types/simple.h index 6a1f58b354..f00da633cb 100644 --- a/src/gromacs/legacyheaders/types/simple.h +++ b/src/gromacs/legacyheaders/types/simple.h @@ -38,19 +38,6 @@ #ifndef _simple_h #define _simple_h -/* Dont remove this instance of HAVE_CONFIG_H!!! - * - * We dont _require_ config.h here, but IF one is - * available it might contain valuable information about simple types - * that helps us automate things better and avoid bailing out. - * - * Note that this does not have to be the gromacs config.h - several - * package setups define these simple types. - */ -#ifdef HAVE_CONFIG_H -# include -#endif - /* Information about integer data type sizes */ #include #define __STDC_LIMIT_MACROS @@ -208,75 +195,17 @@ typedef uint64_t gmx_uint64_t; #define GMX_UINT64_MAX UINT64_MAX #define GMX_UINT64_MIN UINT64_MIN -#ifndef gmx_inline -/* config.h tests for inline definitions and should work on a much wider range - * of compilers, but does not work with installed headers. These compiler checks - * still enable a real inline keyword for the most common compilers. - */ - -/* Try to define suitable inline keyword for gmx_inline. - * Set it to empty if we cannot find one (and dont complain to the user) - */ -#ifndef __cplusplus - -#ifdef __GNUC__ -/* GCC */ -# define gmx_inline __inline__ -#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && defined(__ia64__) -/* ICC */ -# define gmx_inline __inline__ -#elif defined(__PATHSCALE__) -/* Pathscale */ -# define gmx_inline __inline__ -#elif defined(__PGIC__) -/* Portland */ -# define gmx_inline __inline -#elif defined _MSC_VER -/* MSVC */ -# define gmx_inline __inline -#elif defined(__xlC__) -/* IBM */ -# define gmx_inline __inline -#else -# define gmx_inline -#endif - +#if !defined __cplusplus && _MSC_VER +#define gmx_inline __inline #else -/* C++ */ -# define gmx_inline inline +/* C++ or C99 */ +#define gmx_inline inline #endif -#endif /* ifndef gmx_inline */ - - -/* Restrict keywords. Note that this has to be done for C++ too, unless - * it was set from the more general checks if we had config.h (gmx internal) - */ -#ifndef gmx_restrict - -#ifdef __GNUC__ -/* GCC */ -# define gmx_restrict __restrict__ -#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && defined(__ia64__) -/* ICC */ -# define gmx_restrict __restrict__ -#elif defined(__PATHSCALE__) -/* Pathscale */ -# define gmx_restrict __restrict -#elif defined(__PGIC__) -/* Portland */ -# define gmx_restrict __restrict -#elif defined _MSC_VER -/* MSVC */ -# define gmx_restrict __restrict -#elif defined(__xlC__) -/* IBM */ -# define gmx_restrict __restrict -#else -# define gmx_restrict -#endif - -#endif +/* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict. + * Any other compiler can be added here. We cannot + * use restrict because it is in C99 but not in C++ */ +#define gmx_restrict __restrict /* * These attributes suppress compiler warnings about unused function arguments diff --git a/src/gromacs/legacyheaders/types/state.h b/src/gromacs/legacyheaders/types/state.h index 853a822051..3418ab189b 100644 --- a/src/gromacs/legacyheaders/types/state.h +++ b/src/gromacs/legacyheaders/types/state.h @@ -39,7 +39,7 @@ #include "simple.h" -#include "gromacs/swap/enums.h" +#include "../../swap/enums.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/legacyheaders/vec.h b/src/gromacs/legacyheaders/vec.h index e2d120d775..a14dc49dc9 100644 --- a/src/gromacs/legacyheaders/vec.h +++ b/src/gromacs/legacyheaders/vec.h @@ -106,6 +106,13 @@ real trace(matrix m) = trace(m) */ +/* The file only depends on config.h for GMX_SOFTWARE_INVSQRT and + HAVE_*SQRT*. This is no problem with public headers because + it is OK if user code uses a different rsqrt implementation */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "types/simple.h" #include "../math/utilities.h" #include "typedefs.h" diff --git a/src/gromacs/legacyheaders/vsite.h b/src/gromacs/legacyheaders/vsite.h index eb629e111d..2ccc6ed1f9 100644 --- a/src/gromacs/legacyheaders/vsite.h +++ b/src/gromacs/legacyheaders/vsite.h @@ -40,7 +40,6 @@ #include #include "typedefs.h" -#include "types/commrec.h" #ifdef __cplusplus extern "C" { diff --git a/src/gromacs/math/CMakeLists.txt b/src/gromacs/math/CMakeLists.txt index 06d2f09f10..4b3a5b80e4 100644 --- a/src/gromacs/math/CMakeLists.txt +++ b/src/gromacs/math/CMakeLists.txt @@ -40,7 +40,7 @@ set(MATH_PUBLIC_HEADERS gmxcomplex.h utilities.h ) -gmx_install_headers(maths ${MATH_PUBLIC_HEADERS}) +gmx_install_headers(math ${MATH_PUBLIC_HEADERS}) if (BUILD_TESTING) # add_subdirectory(tests) diff --git a/src/gromacs/mdlib/constr.c b/src/gromacs/mdlib/constr.c index 49595554de..4f01f54654 100644 --- a/src/gromacs/mdlib/constr.c +++ b/src/gromacs/mdlib/constr.c @@ -39,6 +39,7 @@ #endif #include "gromacs/fileio/confio.h" +#include "types/commrec.h" #include "constr.h" #include "copyrite.h" #include "invblock.h" diff --git a/src/gromacs/mdlib/coupling.c b/src/gromacs/mdlib/coupling.c index 7d207b9d50..d5e4d9d3ff 100644 --- a/src/gromacs/mdlib/coupling.c +++ b/src/gromacs/mdlib/coupling.c @@ -40,6 +40,7 @@ #include #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "update.h" #include "vec.h" diff --git a/src/gromacs/mdlib/domdec_box.c b/src/gromacs/mdlib/domdec_box.c index 4778e13ada..9348512e64 100644 --- a/src/gromacs/mdlib/domdec_box.c +++ b/src/gromacs/mdlib/domdec_box.c @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,6 +40,7 @@ #include "typedefs.h" #include "vec.h" #include "pbc.h" +#include "types/commrec.h" #include "domdec.h" #include "domdec_network.h" #include "nsgrid.h" diff --git a/src/gromacs/mdlib/domdec_con.c b/src/gromacs/mdlib/domdec_con.c index 53658aa56b..31154f3460 100644 --- a/src/gromacs/mdlib/domdec_con.c +++ b/src/gromacs/mdlib/domdec_con.c @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2006,2007,2008,2009,2010,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,6 +41,7 @@ #include "smalloc.h" #include "vec.h" #include "constr.h" +#include "types/commrec.h" #include "domdec.h" #include "domdec_network.h" #include "mtop_util.h" diff --git a/src/gromacs/mdlib/domdec_network.c b/src/gromacs/mdlib/domdec_network.c index 8e184d38c0..9142d54ae7 100644 --- a/src/gromacs/mdlib/domdec_network.c +++ b/src/gromacs/mdlib/domdec_network.c @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2008,2009,2010,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -38,6 +38,7 @@ #endif #include +#include "types/commrec.h" #include "domdec_network.h" #include "gromacs/utility/gmxmpi.h" diff --git a/src/gromacs/mdlib/domdec_setup.c b/src/gromacs/mdlib/domdec_setup.c index d5fec0dbd6..8e39f16daa 100644 --- a/src/gromacs/mdlib/domdec_setup.c +++ b/src/gromacs/mdlib/domdec_setup.c @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2008,2009,2010,2011,2012,2013, by the GROMACS development team, led by + * Copyright (c) 2008,2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -40,6 +40,7 @@ #include #include #include "domdec.h" +#include "types/commrec.h" #include "network.h" #include "perf_est.h" #include "physics.h" diff --git a/src/gromacs/mdlib/domdec_top.c b/src/gromacs/mdlib/domdec_top.c index 3eea74ab08..1503d9d963 100644 --- a/src/gromacs/mdlib/domdec_top.c +++ b/src/gromacs/mdlib/domdec_top.c @@ -40,6 +40,7 @@ #include #include "typedefs.h" #include "smalloc.h" +#include "types/commrec.h" #include "domdec.h" #include "domdec_network.h" #include "names.h" diff --git a/src/gromacs/mdlib/ewald.c b/src/gromacs/mdlib/ewald.c index 845060173f..740ad32e98 100644 --- a/src/gromacs/mdlib/ewald.c +++ b/src/gromacs/mdlib/ewald.c @@ -41,6 +41,7 @@ #include #include #include "typedefs.h" +#include "types/commrec.h" #include "vec.h" #include "smalloc.h" #include "gmx_fatal.h" diff --git a/src/gromacs/mdlib/forcerec.c b/src/gromacs/mdlib/forcerec.c index 3f4c0d8ddc..bd22a259fa 100644 --- a/src/gromacs/mdlib/forcerec.c +++ b/src/gromacs/mdlib/forcerec.c @@ -43,6 +43,7 @@ #include #include "sysstuff.h" #include "typedefs.h" +#include "types/commrec.h" #include "vec.h" #include "gromacs/math/utilities.h" #include "macros.h" diff --git a/src/gromacs/mdlib/genborn.c b/src/gromacs/mdlib/genborn.c index ff228f9529..edd78818a7 100644 --- a/src/gromacs/mdlib/genborn.c +++ b/src/gromacs/mdlib/genborn.c @@ -43,6 +43,7 @@ #include #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "genborn.h" #include "vec.h" diff --git a/src/gromacs/mdlib/nbnxn_atomdata.c b/src/gromacs/mdlib/nbnxn_atomdata.c index d780c21331..36c5b2c565 100644 --- a/src/gromacs/mdlib/nbnxn_atomdata.c +++ b/src/gromacs/mdlib/nbnxn_atomdata.c @@ -49,6 +49,7 @@ #include "nbnxn_search.h" #include "gromacs/utility/gmxomp.h" #include "gmx_omp_nthreads.h" +#include "thread_mpi/atomic.h" /* Default nbnxn allocation routine, allocates NBNXN_MEM_ALIGN byte aligned */ void nbnxn_alloc_aligned(void **ptr, size_t nbytes) diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu index 2821e54cbd..440c074db3 100644 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu @@ -32,6 +32,9 @@ * To help us fund GROMACS development, we humbly ask that you cite * the research papers on the package. Check out http://www.gromacs.org. */ +#ifdef HAVE_CONFIG_H +#include +#endif #include #include diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h index 576f413ba2..994738f627 100644 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -36,6 +36,10 @@ #ifndef NBNXN_CUDA_H #define NBNXN_CUDA_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include "types/nbnxn_cuda_types_ext.h" #include "types/simple.h" diff --git a/src/gromacs/mdlib/nbnxn_search.c b/src/gromacs/mdlib/nbnxn_search.c index 4f52448ee0..5466bb5288 100644 --- a/src/gromacs/mdlib/nbnxn_search.c +++ b/src/gromacs/mdlib/nbnxn_search.c @@ -43,6 +43,7 @@ #include "sysstuff.h" #include "smalloc.h" +#include "types/commrec.h" #include "macros.h" #include "gromacs/math/utilities.h" #include "vec.h" diff --git a/src/gromacs/mdlib/ns.c b/src/gromacs/mdlib/ns.c index 36ad72c4ef..491d53ee0e 100644 --- a/src/gromacs/mdlib/ns.c +++ b/src/gromacs/mdlib/ns.c @@ -45,6 +45,7 @@ #include "macros.h" #include "gromacs/math/utilities.h" #include "vec.h" +#include "types/commrec.h" #include "network.h" #include "nsgrid.h" #include "force.h" diff --git a/src/gromacs/mdlib/pme_pp.c b/src/gromacs/mdlib/pme_pp.c index e1cab52c1e..5ea913e7b5 100644 --- a/src/gromacs/mdlib/pme_pp.c +++ b/src/gromacs/mdlib/pme_pp.c @@ -44,6 +44,7 @@ #include #include #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "gmx_fatal.h" #include "vec.h" diff --git a/src/gromacs/mdlib/qmmm.c b/src/gromacs/mdlib/qmmm.c index e0d45d2a61..b4fca75f1f 100644 --- a/src/gromacs/mdlib/qmmm.c +++ b/src/gromacs/mdlib/qmmm.c @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,6 +41,7 @@ #include #include "sysstuff.h" #include "typedefs.h" +#include "types/commrec.h" #include "macros.h" #include "smalloc.h" #include "physics.h" diff --git a/src/gromacs/mdlib/shellfc.c b/src/gromacs/mdlib/shellfc.c index 1a4e4b90bd..4cb1bb5a2f 100644 --- a/src/gromacs/mdlib/shellfc.c +++ b/src/gromacs/mdlib/shellfc.c @@ -40,6 +40,7 @@ #include #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "gmx_fatal.h" #include "vec.h" diff --git a/src/gromacs/mdlib/stat.c b/src/gromacs/mdlib/stat.c index e5431b1c7a..f09e9ed4ca 100644 --- a/src/gromacs/mdlib/stat.c +++ b/src/gromacs/mdlib/stat.c @@ -41,6 +41,7 @@ #include #include #include "typedefs.h" +#include "types/commrec.h" #include "sysstuff.h" #include "gmx_fatal.h" #include "network.h" diff --git a/src/gromacs/mdlib/wnblist.c b/src/gromacs/mdlib/wnblist.c index 84661b0cf0..5d142c5ca4 100644 --- a/src/gromacs/mdlib/wnblist.c +++ b/src/gromacs/mdlib/wnblist.c @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013, by the GROMACS development team, led by + * Copyright (c) 2013,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,6 +44,7 @@ #include "string2.h" #include "force.h" #include "smalloc.h" +#include "types/commrec.h" #include "ns.h" #include "nrnb.h" #include "gmx_fatal.h" diff --git a/src/gromacs/pulling/pull.c b/src/gromacs/pulling/pull.c index abb51a55a3..58dbd60c58 100644 --- a/src/gromacs/pulling/pull.c +++ b/src/gromacs/pulling/pull.c @@ -47,6 +47,7 @@ #include "gromacs/fileio/gmxfio.h" #include "vec.h" #include "typedefs.h" +#include "types/commrec.h" #include "network.h" #include "gromacs/fileio/filenm.h" #include diff --git a/src/gromacs/pulling/pullutil.c b/src/gromacs/pulling/pullutil.c index bf8bb137c8..5ffc05787b 100644 --- a/src/gromacs/pulling/pullutil.c +++ b/src/gromacs/pulling/pullutil.c @@ -46,6 +46,7 @@ #include "vec.h" #include "smalloc.h" #include "typedefs.h" +#include "types/commrec.h" #include "names.h" #include "gmx_fatal.h" #include "macros.h" diff --git a/src/gromacs/utility/CMakeLists.txt b/src/gromacs/utility/CMakeLists.txt index 4432ea6aef..def7b9691b 100644 --- a/src/gromacs/utility/CMakeLists.txt +++ b/src/gromacs/utility/CMakeLists.txt @@ -48,7 +48,6 @@ set(UTILITY_PUBLIC_HEADERS flags.h gmx_header_config.h gmxassert.h - gmxmpi.h init.h programcontext.h stringutil.h diff --git a/src/gromacs/utility/gmx_header_config_gen.h.cmakein b/src/gromacs/utility/gmx_header_config_gen.h.cmakein index 603d39cf75..3e99283735 100644 --- a/src/gromacs/utility/gmx_header_config_gen.h.cmakein +++ b/src/gromacs/utility/gmx_header_config_gen.h.cmakein @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012, by the GROMACS development team, led by + * Copyright (c) 2012,2014, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -48,11 +48,14 @@ * \ingroup module_utility */ -/** Detect Cygwin */ -#cmakedefine GMX_CYGWIN +#ifdef __CYGWIN__ +#define GMX_CYGWIN +#endif -/** Detect native (i.e. non-Cygwin) Windows */ -#cmakedefine GMX_NATIVE_WINDOWS +/* We currently don't support MingW. And ICC also defines it */ +#ifdef _MSC_VER +#define GMX_NATIVE_WINDOWS +#endif /** Define if we have sufficient C++11 support */ #cmakedefine GMX_CXX11 diff --git a/src/gromacs/utility/gmxmpi.h b/src/gromacs/utility/gmxmpi.h index 3b36a87db2..640d553f34 100644 --- a/src/gromacs/utility/gmxmpi.h +++ b/src/gromacs/utility/gmxmpi.h @@ -54,6 +54,10 @@ #ifndef GMX_UTILITY_GMXMPI_H #define GMX_UTILITY_GMXMPI_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + /*! \cond */ #ifdef GMX_LIB_MPI /* MPI C++ binding is deprecated and can cause name conflicts (e.g. stdio/mpi seek) */ diff --git a/src/gromacs/utility/gmxomp.h b/src/gromacs/utility/gmxomp.h index c698b5168a..af11cac918 100644 --- a/src/gromacs/utility/gmxomp.h +++ b/src/gromacs/utility/gmxomp.h @@ -53,6 +53,7 @@ #include "config.h" #endif +#ifndef GMX_NATIVE_WINDOWS /* Ugly hack because the openmp implementation below hacks into the SIMD * settings to decide when to use _mm_pause(). This should eventually be * changed into proper detection of the intrinsics uses, not SIMD. @@ -62,6 +63,9 @@ (defined GMX_SIMD_X86_AVX2_256) # include #endif +#else +#include +#endif #include "types/commrec.h" #include "mdrun.h" @@ -118,6 +122,7 @@ void gmx_omp_check_thread_affinity(FILE *fplog, const t_commrec *cr, */ static gmx_inline void gmx_pause() { +#ifndef GMX_NATIVE_WINDOWS /* Ugly hack because the openmp implementation below hacks into the SIMD * settings to decide when to use _mm_pause(). This should eventually be * changed into proper detection of the intrinsics uses, not SIMD. @@ -132,6 +137,9 @@ static gmx_inline void gmx_pause() #else /* No wait for unknown architecture */ #endif +#else + YieldProcessor(); +#endif } /*! \} */ diff --git a/src/programs/mdrun/deform.h b/src/programs/mdrun/deform.h new file mode 100644 index 0000000000..d2106f1cb1 --- /dev/null +++ b/src/programs/mdrun/deform.h @@ -0,0 +1,57 @@ +/* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2014, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ + +#ifndef GMX_MDRUN_DEFORM_H +#define GMX_MDRUN_DEFORM_H + +#include "thread_mpi/threads.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Variables for temporary use with the deform option, + * used in runner.c and md.c. + * (These variables should be stored in the tpx file.) + */ +extern gmx_int64_t deform_init_init_step_tpx; +extern matrix deform_init_box_tpx; +extern tMPI_Thread_mutex_t deform_init_box_mutex; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/programs/mdrun/md.c b/src/programs/mdrun/md.c index 04c48de3fa..8fb7afb3ff 100644 --- a/src/programs/mdrun/md.c +++ b/src/programs/mdrun/md.c @@ -63,6 +63,7 @@ #include "pme.h" #include "mdatoms.h" #include "repl_ex.h" +#include "deform.h" #include "qmmm.h" #include "domdec.h" #include "domdec_network.h" diff --git a/src/programs/mdrun/mdrun.cpp b/src/programs/mdrun/mdrun.cpp index 332d64e5e8..4767c1a513 100644 --- a/src/programs/mdrun/mdrun.cpp +++ b/src/programs/mdrun/mdrun.cpp @@ -51,6 +51,7 @@ #include "gromacs/legacyheaders/network.h" #include "gromacs/legacyheaders/readinp.h" #include "gromacs/legacyheaders/typedefs.h" +#include "gromacs/legacyheaders/types/commrec.h" #include "gromacs/commandline/pargs.h" #include "gromacs/fileio/filenm.h" diff --git a/src/programs/mdrun/membed.c b/src/programs/mdrun/membed.c index 77231a1130..a7b66b60fb 100644 --- a/src/programs/mdrun/membed.c +++ b/src/programs/mdrun/membed.c @@ -39,6 +39,7 @@ #include #include #include "typedefs.h" +#include "types/commrec.h" #include "smalloc.h" #include "sysstuff.h" #include "vec.h" diff --git a/src/programs/mdrun/pme_loadbal.c b/src/programs/mdrun/pme_loadbal.c index 63efb07eea..1caf80e26d 100644 --- a/src/programs/mdrun/pme_loadbal.c +++ b/src/programs/mdrun/pme_loadbal.c @@ -37,6 +37,7 @@ #endif #include "smalloc.h" +#include "types/commrec.h" #include "network.h" #include "calcgrid.h" #include "pme.h" diff --git a/src/programs/mdrun/runner.c b/src/programs/mdrun/runner.c index 96d4f2f06c..30044a2d19 100644 --- a/src/programs/mdrun/runner.c +++ b/src/programs/mdrun/runner.c @@ -60,6 +60,7 @@ #include "pme.h" #include "mdatoms.h" #include "repl_ex.h" +#include "deform.h" #include "qmmm.h" #include "domdec.h" #include "coulomb.h" @@ -109,6 +110,12 @@ tMPI_Thread_mutex_t deform_init_box_mutex = TMPI_THREAD_MUTEX_INITIALIZER; #ifdef GMX_THREAD_MPI +/* The minimum number of atoms per tMPI thread. With fewer atoms than this, + * the number of threads will get lowered. + */ +#define MIN_ATOMS_PER_MPI_THREAD 90 +#define MIN_ATOMS_PER_GPU 900 + struct mdrunner_arglist { gmx_hw_opt_t hw_opt;